home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / ckc095.zip / ckoker.mss < prev    next >
Text File  |  1989-06-20  |  86KB  |  2,018 lines

  1. @make(manual)
  2. @use(database="ERCY02:SCRIBEX")
  3. @style(font timesroman12)
  4. @libraryfile(misc)
  5. @modify(description, spread 1)
  6. @string(ckoversion="1.00")
  7. @string(NODEBUGLOG="(Debug logging is disabled.)")
  8. @string(no="no. ")
  9. @define(exx=example,above 2,below 1)
  10. @define(mydesc=text,leftmargin +8, indent -8)
  11. @define(q=t)
  12. @define(qq=t)
  13. @begin(text, indent 0)
  14. @majorheading(C-Kermit for OS/2)
  15. @centre(Version @value<ckoversion>)
  16. @centre(by Chris Adie et al.)
  17.  
  18. @begin(format, centred)
  19. Copyright (C) 1988 Edinburgh University Computing Service.
  20. Portions of this document are Copyright (C) 1981, 1988 Trustees
  21. of Columbia University in the city of New York.
  22.  
  23.  
  24. Permission is granted to any individual or institution to use, copy,
  25. or redistribute this document so long as it is not sold for
  26. profit, and provided this copyright notice is retained.
  27. @end(format)
  28.  
  29. @section(Introduction)
  30. @subsection(Acknowledgements)
  31. C-Kermit was written by Frank da Cruz, Bill Catchings, Jeff Damens and
  32. Herm Fischer, with contributions by many others.  It was originally
  33. written for computers running the Unix operating system, but it has been
  34. ported to the VAX running VMS, the Apple Macintosh and the Commodore
  35. Amiga, among others.  The program was ported to OS/2 by Chris Adie
  36. (Edinburgh University Computing Service).
  37.  
  38. This documentation is based closely on the C-Kermit manual by Frank da
  39. Cruz and Herm Fischer.  The section on the OS/2 file system is based on
  40. the MS-Kermit manual, by Christine Gianone, Frank da Cruz and Joe
  41. Doupnik.  It should be read in conjunction with a more general
  42. description of Kermit such as "The Kermit File Transfer Protocol" by
  43. Frank da Cruz (Digital Press, ISBN 0-932376-88-6), or the Kermit User
  44. Guide, available in machine readable form from your nearest Kermit
  45. distribution centre. 
  46.  
  47. @subsection<OS/2 Kermit Capabilities>
  48. C-Kermit provides traditional (Unix-style) command line operation as
  49. well as interactive command prompting and execution.  The command line
  50. options provide access to a basic subset of C-Kermit's capabilities; the
  51. interactive command set is far richer. 
  52.  
  53. C-Kermit is a protected-mode program.  It will not run in the DOS
  54. compatability environment.  This means that it will continue running
  55. (eg transferring files) even when it is not the foreground session. 
  56.  
  57. @i(All numbers in the C-Kermit documentation are decimal unless noted
  58. otherwise.)
  59.  
  60. @need(32)
  61. Summary of capabilities:
  62. @begin<format,leftmargin +2,above 1,below 1>
  63. @tabclear()@tabset(3.5inches,4.0inches)
  64. Local operation:@\Yes
  65. Remote operation:@\No
  66. Login scripts:@\Yes (UUCP style)
  67. Transfer text files:@\Yes
  68. Transfer binary files:@\Yes
  69. Wildcard send:@\Yes
  70. File transfer interruption:@\Yes
  71. Filename collision avoidance:@\Yes
  72. Can time out:@\Yes
  73. 8th-bit prefixing:@\Yes
  74. Repeat count prefixing:@\Yes
  75. Alternate block checks:@\Yes
  76. Terminal emulation:@\Yes
  77. Communication settings:@\Yes
  78. Transmit BREAK:@\Yes
  79. Support for dialout modems:@\Yes
  80. IBM mainframe communication:@\Yes
  81. Transaction logging:@\Yes
  82. Session logging:@\Yes
  83. Debug logging:@\Yes @value(NODEBUGLOG)
  84. Packet logging:@\Yes
  85. Act as server:@\Yes
  86. Talk to server:@\Yes
  87. Advanced server functions:@\Yes
  88. Local file management:@\Yes
  89. Command/Init files:@\Yes
  90. Long packets:@\Yes
  91. Sliding Windows:@\No
  92. File attributes packets:@\No
  93. Command macros:@\No
  94. Raw file transmit:@\No
  95. @end<format>
  96.  
  97. @subsection(Requirements)
  98.  
  99. C-Kermit will run on a computer with an 80286 or 80386 processor running
  100. OS/2 version 1.0 or higher.  It runs in character mode - in other words it
  101. is not a Presentation Manager application.  However, it will run in a
  102. Presentation Manager window as a character application.  Normally, though,
  103. you would run it from the command processor (CMD.EXE) prompt.
  104.  
  105. @subsection(The Serial Port)
  106. Naturally, a serial port (COM1 or COM2) is required.  The OS/2 Standard
  107. Edition comms port device driver must be loaded using a line like one of
  108. the following in the CONFIG.SYS file:
  109.  
  110. @begin(example)
  111. @tabset(2 inches)
  112. @\DEVICE=COM01.SYS
  113. @i(or)@\DEVICE=COM02.SYS
  114. @end(example)
  115.  
  116. COM01.SYS is used for PC/AT - type machines, while for PS/2s COM02.SYS
  117. must be used.  C-Kermit @i'will not work' if this device driver is not
  118. loaded.  (It provides the Category 1 IOCTLs which are used extensively
  119. within the program.)
  120.  
  121. The connecting cable and the modem (or other computer, PAD etc to which
  122. your computer is connected) must satisfy the requirements of your
  123. computer's RS232 interface.  In particular, the computer will provide
  124. two output control signals (RTS and DTR), and may expect to see signals
  125. on four input lines (DCD, DSR, CTS, RI).  The precise behaviour of these
  126. lines is software configurable (for instance by using the OS/2
  127. '@q(MODE)' command), and C-Kermit makes no attempt to impose a
  128. particular method of using them. 
  129.  
  130. By default, the DTR and RTS line will both go ON when C-Kermit opens the
  131. comms port, and they will go OFF when it is closed.
  132.  
  133. The default behaviour for the input lines is that DSR and CTS must be ON
  134. to enable the port to work.  If the modem you are connected to does not
  135. provide these signals, you can 'loop back' the RTS output signal from
  136. the computer to DSR and CTS, using a suitably modified cable.  An alternative
  137. is to use the MODE command to disable the DSR and CTS inputs.  To do this,
  138. type a command similar to the following at the OS/2 CMD prompt:
  139. @begin(example)
  140. MODE COM1:9600,N,8,1,OCTS=OFF,ODSR=OFF,IDSR=OFF
  141. @end(example)
  142. You can check the effect using:
  143. @begin(example)
  144. MODE COM1
  145. @end(example)
  146. which reports the current settings of COM1.  Note that on some machines,
  147. C-Kermit may appear to work even although DSR and CTS are not connected
  148. to anything, nor disabled using '@q(MODE)'.  This is because unconnected
  149. input lines tend to 'float high'.  Although this situation may not cause
  150. any problems, it is not good practice - you should explicitly disable
  151. the inputs as above. 
  152.  
  153. The '@q(MODE)' utility also allows you to change the baud rate, parity,
  154. number of data bits and number of stop bits.  C-Kermit provides
  155. facilities for changing the baud rate and parity too (see later in this
  156. manual), but when it starts up, it resets the parity to none and the
  157. number of data bits to 8.  Any changes to baud rate and parity will
  158. remain in effect after C-Kermit terminates.
  159.  
  160. If you change the parity within C-Kermit, it will ajust the number of data
  161. bits to cope.  There is no way of changing the number of stop bits within
  162. C-Kermit: use '@q(MODE)' to do this.
  163.  
  164. @subsection(Emergency Exit)
  165. @begin(quotation)
  166. @i(EMERGENCY EXIT:)@index<Emergency Exit>
  167. The Control-C key cannot be used to terminate C-Kermit.  The Control-Break
  168. key will always work, but it takes you back to the Program Selector rather
  169. than the CMD.EXE command interpreter from which Kermit was invoked.
  170. @end(quotation)
  171. @newpage
  172. @section(The OS/2 File System)
  173.  
  174. The features of the OS/2 file system of greatest interest to Kermit users are
  175. the form of the file specifications, and the formats of the files themselves.
  176. Note that the following discussion refers to the MS-DOS compatible file
  177. system supported by initial versions of OS/2.  Installable file systems
  178. are not covered here - they are significantly different, and the extent to
  179. which C-Kermit will work under such file systems is unknown (because no
  180. installable file system has been released at the time of writing).
  181.  
  182. @subsection(File Specifications)
  183.  
  184. OS/2 file specifications are of the form
  185.  
  186. @exx(@c[DEVICE@q(:\)PATHNAME@q(\)NAME@q(.)TYPE])
  187.  
  188. where @c{DEVICE} stands for a single character identifier (for instance, @q(A) for
  189. the first floppy disk, @q(C) for the first fixed disk, @q(D) for a RAM disk
  190. emulator) followed by a colon ('@q(:)'), @c[PATHNAME] is up to 63 characters
  191. of identifier(s) (up to 8 characters each) surrounded by backslashes
  192. ('@q(\)'), @c[NAME] is an identifier of up to 8 characters, and @c[TYPE] is an
  193. identifier of up to 3 characters in length.  Device and pathname may be
  194. omitted.  The first backslash in the pathname may be omitted if the
  195. specified path is relative to the current directory.  In the path field,
  196. '@q(.)' means the current directory, '@q(..)' means the parent directory.
  197.  
  198. Pathname is normally omitted, but can be specified in all C-Kermit
  199. commands.  Device and directory pathnames, when omitted, default to
  200. either the user's current disk and directory, or to the current
  201. directory search path as specified in the PATH environment variable,
  202. depending on the context in which the file name appears. 
  203.  
  204. When this document says that a file is searched for "in the current
  205. path," it means that C-Kermit looks on the current disk and directory
  206. first, and if the file is not found, then the directories listed in the
  207. PATH environment variable are searched.  If the PATH environment
  208. variable is empty, Kermit looks only at the current disk and directory. 
  209.  
  210. @i[NAME.TYPE] is sufficient to specify a file on the current disk and
  211. directory, and only this information is sent along by C-Kermit with an
  212. outgoing file (by default).
  213.  
  214. The device, path, name, and type fields may contain uppercase letters,
  215. digits, and the special characters '@q[-]' (dash), '@q[_]' (underscore),
  216. '@q[$]' (dollar sign), '@q[&]' (ampersand), '@q[@hash()]' (number sign),
  217. '@q[@@]' (at sign), '@q[!]' (exclamation mark), '@q[']' (single quote),
  218. '@q[()]' (parentheses), '@q[{}]' (curly braces), '@q[^]' (caret or
  219. circumflex), '@q[~]' (tilde), and '@q[`]' (accent grave).  Normally, you
  220. should confine your filenames to letters and digits for maximum
  221. transportability to non-OS/2 systems (by default, C-Kermit will
  222. translate filenames being sent by converting non-alphanumeric characters
  223. to '@q(X)').  When you type lowercase letters in filenames, they are
  224. converted automatically to uppercase.  There are no imbedded or trailing
  225. spaces.  Other characters may not be included; there is no mechanism for
  226. "quoting" otherwise illegal characters in filenames.  The fields of the
  227. file specification are set off from one another by the punctuation
  228. indicated above (ie colon, backslash and dot). 
  229.  
  230. The name field is the primary identifier for the file.  The type, also
  231. called the extension or suffix, is an indicator which, by convention,
  232. tells what kind of file we have.  For instance @q[FOO.BAS] is the source of
  233. a BASIC program named FOO; @q[FOO.OBJ] might be the relocatable object
  234. module produced by compiling @q[FOO.BAS]; @q[FOO.EXE] could be an executable
  235. program produced by loading @q[FOO.OBJ], and so forth.  @q[.EXE] is
  236. the normal suffix for executable programs. 
  237.  
  238. OS/2 allows a group of files to be specified in a single file
  239. specification by including the special "wildcard" characters, '@q[*]' and
  240. '@q[?]'.  A '@q[*]' matches any string of characters from the current position
  241. to the end of the field, including no characters at all; a '@q[?]' matches
  242. any single character.  Here are some examples:
  243. @begin(description)
  244. @tabclear()@tabset(1.5 inches)
  245. @q[*.BAS]@\All files of type BAS (BASIC source files) in the current directory.
  246.  
  247. @q[FOO.*]@\Files of all types with name FOO.
  248.  
  249. @q[F*.*]@\All files whose names start with F.
  250.  
  251. @q[*.?]@\All files with types exactly one character long, or with no type at all.
  252. @end(description) 
  253. Wildcard  notation  is used on many computer systems in similar ways, and it is
  254. the mechanism most commonly used to instruct Kermit to send a group of files.
  255.  
  256. You should bear in mind that other (non-OS/2) systems may use different
  257. wildcard characters.  For instance VMS and the DEC-20 use '@q[%]' instead of
  258. '@q[?]' as the single character wildcard; when using C-Kermit to request a
  259. wildcard file group from a Kermit-20 server, the OS/2 '@q[?]' must be
  260. replaced by the DEC-20 '@q[%]'. 
  261.  
  262.  
  263. @subsection(File Formats)
  264.  
  265. OS/2 systems store files as streams of 8-bit bytes, with no particular
  266. distinction among text, program code, and binary files.  ASCII text
  267. files consist of lines separated by carriage-return-linefeed sequences
  268. (CRLFs), and this conforms exactly to the way Kermit represents text
  269. files during transmission.
  270.  
  271. OS/2 (unlike CP/M) knows the exact end of a file because it keeps a byte
  272. count in the directory, so one would expect no particular confusion in
  273. this regard.  However, certain MS-DOS and OS/2 programs continue to use the CP/M
  274. convention of terminating a text file with a Control-Z character.  This
  275. may cause problems when the file is transferred elsewhere, since other
  276. systems may object to the Control-Z.  By default, therefore, C-Kermit
  277. treats the first Control-Z it finds in the file as being equivalent to
  278. end-of-file.  The Control-Z is not transmitted to the other system.  Of
  279. course, this leads to problems when transferring non-text files, when we
  280. @i(do) want any Control-Zs in the file to be sent.  To achieve this, the
  281. C-Kermit '@q(set file type binary)' command may be used.  The opposite, '@q(set
  282. file type text)', is the default. 
  283.  
  284. Non-OS/2  systems  may  be  confused  by  nonstandard  ASCII  files  sent  by
  285. C-Kermit:
  286. @begin(itemize)
  287. Files  containing  any  of  the 8-bit "extended ASCII" characters may
  288. need conversion (or translation) to 7-bit ASCII.
  289.  
  290. Files produced by word processing programs like Word Perfect or Wordstar
  291. may contain special binary formatting codes, and could need conversion
  292. to conventional 7-bit ASCII format prior to transmission, using commonly
  293. available "exporter" programs. 
  294.  
  295. Spreadsheet or database files usually need special formatting  to  be
  296. meaningful  to  non-OS/2 recipients (though they can be transmitted
  297. between OS/2 and MS-DOS systems with Kermit).
  298.  
  299. BASIC programs are normally saved in a binary "tokenized" form.   Use
  300. BASIC's "@q(,a)" option to save them as regular ASCII text, as in
  301. @begin(example) 
  302.          save"foofa",a
  303. @end(example)
  304. @end(itemize) 
  305. In  general,  when  attempting  to transfer non-text files between OS/2 and a
  306. different kind of system, consult the Kermit manual for that system.
  307.  
  308.  
  309. @newpage
  310. @section(File Transfer)
  311.  
  312. When C-Kermit is transferring a file, the screen (stdout) is continously updated to
  313. show the progress of the file transer.  A dot is printed for every four data
  314. packets, other packets are shown by type:
  315. @begin(description,leftmargin +6, indent -2, spread 0)
  316. I@\Exchange Parameter Information
  317.  
  318. R@\Receive Initiate
  319.  
  320. S@\Send Initiate
  321.  
  322. F@\File Header
  323.  
  324. G@\Generic Server Command
  325.  
  326. C@\Remote Host Command
  327.  
  328. N@\Negative Acknowledgement (NAK)
  329.  
  330. E@\Fatal Error
  331.  
  332. T@\Indicates a timeout occurred
  333.  
  334. Q@\Indicates a damaged, undesired, or illegal packet was received
  335.  
  336. @q<%>@\Indicates a packet was retransmitted
  337. @end(description)
  338. You may type certain "interrupt" commands during file transfer:
  339. @begin(description,leftmargin +16,indent -12,spread 0)
  340. Control-F:@\Interrupt the current File, and go on to the next (if any).
  341.  
  342. Control-B:@\Interrupt the entire Batch of files, terminate the transaction.
  343.  
  344. Control-R:@\Resend the current packet.
  345.  
  346. Control-A:@\Display a status report for the current transaction.
  347. @end(description)
  348. These interrupt characters differ from the ones used in other Kermit
  349. implementations to avoid conflict with commonly used Unix shell interrupt
  350. characters.  This reason, of course, is not valid under OS/2, and in
  351. a future version of C-Kermit for OS/2 it is hoped to rectify this.
  352.  
  353. @begin(quotation)
  354. @i(CAUTION:)@index(Warning)@index<File Warning>
  355. If Control-F or Control-B is used to cancel an incoming file,
  356. and a file of the same name previously existed, @i(and) the "file warning"
  357. feature is not enabled, then the previous copy of the file will disappear.
  358. @end(quotation)
  359.  
  360. The Emergency Exit key (Control-Break) can be used to terminate Kermit
  361. in the middle of a file transfer.  This will not terminate the transfer
  362. gracefully (it is a 'brute force' method), so the remote Kermit system
  363. may be left in an undefined state.
  364.  
  365. @newpage
  366. @section(Command Line Operation)
  367.  
  368. The C-Kermit command line syntax conforms to the @ux(Proposed Syntax Standards
  369. for Unix System Commands) put forth by Kathy Hemenway and Helene Armitage of
  370. AT&T Bell Laboratories in @i(Unix/World), Vol.1, No.3, 1984.  The implications
  371. of this for specifying command-line options are:
  372. @begin(itemize,spread 0)
  373. An option name is a single character.
  374.  
  375. Options are delimited by '@q(-)'.
  376.  
  377. Options with no arguments may be grouped (bundled) behind one delimiter.
  378.  
  379. Options which take an argument must not have the argument omitted.
  380.  
  381. Arguments immediately follow options, separated by whitespace.
  382.  
  383. The order of options does not matter.
  384.  
  385. A '@q(-)' preceded and followed by whitespace means standard input.
  386.  
  387. A group of bundled options may end with an option that has an argument.
  388. @end(itemize) 
  389. The following notation is used in command descriptions:
  390. @begin(description,leftmargin +8,indent -8)
  391. @i(fn)@\An OS/2 file specification, possibly containing the "wildcard"
  392. characters '@q[*]' or '@q[?]'.
  393.  
  394. @i(fn1)@\An OS/2 file specification which may not contain '@q[*]' or '@q[?]'.
  395.  
  396. @i(rfn)@\A remote file specification in the remote system's own syntax, which
  397. may denote a single file or a group of files.
  398.  
  399. @i(rfn1)@\A remote file specification which should denote only a single file.
  400.  
  401. @i(n)@\A decimal number between 0 and 94.
  402.  
  403. @i(c)@\A decimal number between 0 and 127 representing the value of an
  404. ASCII character.
  405.  
  406. @i(cc)@\A decimal number between 0 and 31, or else exactly 127,
  407. representing the value of an ASCII control character.
  408.  
  409. @q([ ])@\Any field in square braces is optional.
  410.  
  411. @q({x,y,z})@\Alternatives are listed in curly braces.
  412. @end(description)
  413.  
  414. C-Kermit command line options may specify any combination of actions and
  415. settings.  If C-Kermit is invoked with a command line that specifies no
  416. actions, then it will issue a prompt and begin interactive dialog.  Action
  417. options specify either protocol transactions or terminal connection.
  418. @subsection(Command Line Options) 
  419. @begin<description,leftmargin +8,indent -8>
  420. @q(-s )@i(fn)@\Send the specified file.
  421. If @i(fn) is '@q[-]' then kermit sends from standard input, which may
  422. come from a file:
  423. @example(kermit -s - < foo.bar)
  424. or a parallel process:
  425. @example(dir *.txt | kermit -s -)
  426. You cannot use this mechanism to send
  427. console typein.  If you want to send a file whose actual name is '@q(-)'
  428. you can precede it with a path name, as in
  429. @example(kermit -s .\-)
  430. The argument @i(fn) may contain wildcards.  For instance,
  431. @example(kermit -s ck*.h)
  432. will send all the files matching the specification '@q(ck*.h)'.
  433.  
  434. @q(-r)@\Receive a file or files.  Wait passively for files to arrive.
  435.  
  436. @q(-k)@\Receive (passively) a file or files, sending them to standard
  437. output.  This option can be used in several ways:
  438.  
  439. @begin(mydesc)
  440. @q(kermit -k)@*Displays the incoming files on your screen.
  441.  
  442. @q(kermit -k > )@i(fn1)@*Sends the incoming file or files to the named file,
  443. @i(fn1).  If more than one file arrives, all are concatenated together
  444. into the single file @i(fn1).
  445.  
  446. @q(kermit -k | command)@*Pipes the incoming data (single or multiple
  447. files) to the indicated command, as in
  448. @example'kermit -k | sort > sorted.txt'
  449. @end(mydesc)
  450.  
  451. @q(-a )@i(fn1)@\If you have specified a file transfer option, you may give
  452. an alternate name for a single file with the @q(-a) ("as") option.  For
  453. example,
  454. @example'kermit -s foo -a bar'
  455. sends the file @q(foo) telling the receiver that its name is @q(bar).
  456. If more than one file arrives or is sent, only the first file is
  457. affected by the @q(-a) option:
  458. @example'kermit -ra baz'
  459. stores the first incoming file under the name @q(baz).
  460.  
  461. @q(-x)@\Begin server operation.
  462. @end(description)
  463.  
  464. Before proceeding, a few words about remote and local operation are
  465. necessary.  Kermit (in general, not just C-Kermit) is "local" if it is
  466. running on PC or workstation that you are using directly, or if it is
  467. running on a multiuser system and transferring files over an external
  468. communication line -- not your job's controlling terminal or console. 
  469. Kermit is remote if it is running on a multiuser system and transferring
  470. files over its own controlling terminal's communication line, connected
  471. to your PC or workstation. 
  472.  
  473. C-Kermit running under OS/2 is always used in local mode, with the
  474. serial port at the back of the machine designated for file transfer and
  475. terminal connection.  Which serial port to use is determined by the
  476. @q(-l) command-line option:
  477.  
  478. @begin(description,leftmargin +8,indent -8)
  479. @q(-l )@i(dev)@\Line  -- Specify a serial line to use for file
  480. transfer and terminal connection, as in
  481. @example'kermit -l com2'
  482. The default line is COM1.
  483. @end(description)
  484.  
  485. There are a number of other options associated with the use of the serial
  486. port:
  487.  
  488. @begin(description,leftmargin +8,indent -8)
  489. @q(-b )@i(n)@\Baud  -- Specify the baud rate for the line given in the
  490. @q(-l) option, as in
  491. @example'kermit -l com2 -b 9600'
  492. It is good practice to include this with the @q(-l) option, since the
  493. current speed of the serial port might not be what you expect.
  494.  
  495. @q(-p )@i(x)@\Parity -- @i(x) may be one of @q(e),@q(o),@q(m),@q(s),@q(n)
  496. (even, odd, mark, space, or none).  If parity
  497. is other than none, then the 8th-bit prefixing mechanism will be
  498. used for transferring 8-bit binary data, provided the opposite
  499. Kermit agrees.  The default parity is none.
  500.  
  501. @q(-t)@\Specifies half duplex, line turnaround with XON as the handshake
  502. character.
  503. @end(description)
  504.  
  505. The following command line options access a remote Kermit server:
  506.  
  507. @begin(description,leftmargin +8,indent -8)
  508. @q(-g )@i(rfn)@\Actively request a remote server to send the named file
  509. or files; @i(rfn) is a file specification in the remote host's own syntax.
  510.  
  511. @q(-f)@\Send a 'finish' command to a remote server.
  512. @end(description)
  513. The following command line options are to do with connecting to the remote
  514. system as a terminal: 
  515. @begin(description,leftmargin +8,indent -8)
  516. @q(-c)@\Establish a terminal connection over the specified or default
  517. communication line, before any protocol transaction takes place.
  518. Get back to the local system by typing the escape character
  519. (normally Control-@q<]>) followed by the letter '@q(c)'.
  520.  
  521. @q(-n)@\Like @q(-c), but @i(after) a protocol transaction takes place;
  522. @q(-c) and @q(-n) may both be used in the same command.  The use of @q(-n)
  523. and @q(-c) is illustrated below.
  524. @end(description)
  525.  
  526. Several other command-line options are provided:
  527. @begin(description,leftmargin +8,indent -8)
  528. @q(-i)@\Specifies that files should be sent or received exactly "as is" with no
  529. conversions.  This option is necessary for transmitting binary files, and is 
  530. equivalent to the '@q(set file type binary)' interactive command.
  531.  
  532. @q(-w)@\Write-Protect -- Avoid filename collisions for incoming files.
  533.  
  534. @q(-e @i<n>)@\Extended packet length -- Specify that C-Kermit is allowed to
  535. receive packets up to length @i<n>, where @i<n> may be between 10 and some
  536. large number, like 1000, depending on the system.  The default maximum length
  537. for received packets is 90.  Packets longer than 94 will be used only if the
  538. other Kermit supports, and agrees to use, the "long packet" protocol extension.
  539.  
  540. @q(-q)@\Quiet -- Suppress screen update during file transfer, for instance
  541. to allow a file transfer to proceed in the background.
  542.  
  543. @q(-d)@\Debug -- Record debugging information in the file @q(debug.log) in
  544. the current directory.  Use this option if you believe the program
  545. is misbehaving, and show the resulting log to your local
  546. Kermit maintainer. @value(NODEBUGLOG)
  547.  
  548. @q(-h)@\Help -- Display a brief synopsis of the command line options.
  549.  
  550. @q(-u @i<d>)@\File handle -- The argument @i<d> is the numerical value of
  551. an open file handle which Kermit will use for its communication line.  This
  552. option is for use only by other programs which interface with Kermit, not for
  553. typing in the command line (so it's not described in the help information from
  554. @q(-h)). Further details are given in the Appendix.
  555. @end(description)
  556. The command line may contain no more than one protocol action option (ie only
  557. one of: @q(-s), @q(-a), @q(-r), @q(-k), @q(-x), @q(-g), @q(-f)).
  558.  
  559. Files are sent with their own names, except that lowercase letters are
  560. raised to upper, drive specifiers and pathnames are stripped off, and
  561. non-alphanumeric characters (excepting the dot) are changed to '@q(X)'. 
  562. Incoming files are stored under their own names.  If @q(-w) was
  563. specified, a "generation number" is appended to the name if it has the
  564. same name as an existing file which would otherwise be overwritten.  If
  565. the @q(-a) option is included, then the same rules apply to its
  566. argument.  The file transfer display shows any transformations performed
  567. upon filenames. 
  568.  
  569. During transmission, files are encoded as follows:
  570. @begin(itemize)
  571. Control characters are converted to prefixed printables.
  572.  
  573. Sequences of repeated characters are collapsed via repeat counts, if
  574. the other Kermit is also capable of repeated-@|character compression.
  575.  
  576. If parity is being used on the communication line, data characters with
  577. the 8th (parity) bit on are specially prefixed (provided the other Kermit
  578. is capable of 8th-bit prefixing; if not, 8-bit binary files cannot be
  579. successfully transferred).
  580. @end(itemize)
  581.  
  582. @subsection(Command Line Examples)
  583.  
  584. @exx(kermit -l com1 -b 1200 -cn -r)
  585. This command connects you to the system on the other end of COM1 at
  586. 1200 baud, where you presumably log in and run Kermit with a '@q(send)'
  587. command.  After you escape back, C-Kermit waits for a file (or files) to
  588. arrive.  When the file transfer is completed, you are reconnected to
  589. the remote system so that you can logout.
  590.  
  591. @exx(kermit -l com2 -b 9600 -cntp m -r -a foo.bar)
  592. This command is like the preceding one, except the remote system in this
  593. case uses half duplex communication with mark parity.  The first file
  594. that arrives is stored under the name @q(foo.bar).
  595.  
  596. @exx(kermit -nf)
  597. This command would be used to shut down a remote server and then connect
  598. to the remote system, in order to log out or to make further use of it.
  599. The @q(-n) option is invoked @i(after) @q(-f) (@q[-c] would have been invoked
  600. before).  This example assumes that the remote server is connected to COM1
  601. (Kermit's default comms port), and that the current baud rate of the port
  602. is acceptable to the remote server.
  603.  
  604. @exx(kermit -wx)
  605. This command starts up C-Kermit as a server.  
  606. Incoming files that have the same names as existing files are given
  607. new, unique names.
  608.  
  609. @exx(kermit -l com2 -b 9600)
  610. This command sets the communication line and speed.  Since no action is
  611. specified, C-Kermit issues a prompt and enters an interactive dialog
  612. with you.  Any settings given on the command line remain in force during
  613. the dialog, unless explicitly changed (eg in this case by '@q(set line)'
  614. or '@q(set speed)' commands). 
  615.  
  616. @exx(kermit)
  617. This command starts up Kermit interactively with all default settings. The
  618. serial line used will be COM1, and the speed used will be the current speed
  619. of COM1.
  620.  
  621. A final example shows how a (hypothetical) OS/2 compression utility might be used to speed
  622. up Kermit file transfers:
  623. @begin(example)
  624. compress < file | kermit -is -     @i[(sender)]
  625. kermit -ik | uncompress > file     @i[(receiver)]
  626. @end(example)
  627.  
  628. @subsection(Exit Status Codes)
  629.  
  630. C-Kermit returns an exit status of zero, except when a fatal error is
  631. encountered, when the exit status is set to one.  This can be used in a batch
  632. file, to take some action depending on whether the operation was successful.
  633. For instance, suppose the file @q(SEND.CMD) contains the following:
  634. @begin(example)
  635. echo Sending %1 out port %2
  636. kermit -ql COM%2 -b 9600 -s %1
  637. if ERRORLEVEL 1 goto badend
  638. echo Transferred succcessfully!
  639. goto end
  640. :badend
  641. echo Transfer problems!
  642. :end
  643. @end(example)
  644. To send a file @q(FOO.BAS), you could type:
  645. @exx(send foo.bas 2)
  646. to send it to another computer running Kermit, connected to port COM2.  
  647. If the transfer completed OK, you would get the message '@q(Transferred
  648. successfully!)'.
  649. @newpage
  650. @section(Interactive Operation)
  651.  
  652. C-Kermit's interactive command prompt is "@q(C-Kermit>)".  In response to this
  653. prompt, you may type any valid interactive C-Kermit command.  C-Kermit executes
  654. the command and then prompts you for another command.  The process continues
  655. until you instruct the program to terminate.
  656.  
  657. Commands begin with a keyword, normally an English verb, such as
  658. '@q(send)'.  You may omit trailing characters from any keyword, so long
  659. as you specify sufficient characters to distinguish it from any other
  660. keyword valid in that field.  Certain commonly-@|used keywords (such as
  661. '@q(send)', '@q(receive)', '@q(connect)') also have special non-@|unique
  662. abbreviations ('@q(s)' for '@q(send)', '@q(r)' for '@q(receive)',
  663. '@q(c)' for '@q(connect)'). 
  664.  
  665. Certain characters have special functions during typein of interactive
  666. commands:
  667. @Begin(Description,leftmargin +8,indent -4)
  668. @q(?)@\Question mark, typed at any point in a command, will produce a
  669. message explaining what is possible or expected at that point.  Depending on
  670. the context, the message may be a brief phrase, a menu of keywords, or a list
  671. of files.
  672.  
  673. @q(ESC)@\(The Escape key) -- Request completion of the current
  674. keyword or filename, or insertion of a default value.  The result will be a
  675. beep if the requested operation fails.
  676.  
  677. @q(BS)@\(Backspace) -- Delete the previous character from the command.
  678.  
  679. @q(^W)@\(Control-W) -- Erase the rightmost word from the command line.
  680.  
  681. @q(^U)@\(Control-U) -- Erase the entire command.
  682.  
  683. @q(^R)@\(Control-R) -- Redisplay the current command.
  684.  
  685. @q(SP)@\(Space) -- Delimits fields (keywords, filenames, numbers) within
  686. a command.  The tab key may also be used for this purpose.
  687.  
  688. @q(CR)@\(Carriage Return or Enter) -- Enters the command for execution.  LF (Linefeed or Control-J)
  689. or FF (formfeed or Control-L) may also be used for this purpose.
  690.  
  691. @q(^)@\(Circumflex) -- Enter any of the above characters into the command,
  692. literally.  To enter a @q(^), type two of them in a row (@q[^^]).
  693. A circumflex at the end of a command line causes the next line to be treated
  694. as a continuation line; this is useful for readability in command files,
  695. especially in the 'script' command.
  696. @end(description)
  697. You may type the editing characters (@q[BS], @q[^W], etc) repeatedly, to
  698. delete all the way back to the prompt.  No action will be performed until the
  699. command is entered by typing carriage return, linefeed, or formfeed.  If you
  700. make any mistakes, you will receive an informative error message and a new
  701. prompt -- make liberal use of '@q[?]' and '@q(ESC)' to feel your way through the
  702. commands.  One important command is '@q(help)' -- you should use it the first time
  703. you run C-Kermit.
  704.  
  705. A command line beginning with a percent sign '@q(%)' is ignored.  Such
  706. lines may be used to include illustrative commentary in Kermit command dialogs.
  707.  
  708. Interactive C-Kermit accepts commands from files as well as from the keyboard.
  709. When you start C-Kermit, the program looks for a file @q(CKERMIT.INI) in
  710. the current PATH, and executes any commands it finds there.
  711. The commands in @q(CKERMIT.INI) must be
  712. in interactive format, not in the command-@|line format.  A '@q(take)' command is
  713. also provided for use at any time during an interactive session, to allow
  714. interactive-format commands to be executed from a file; command files may be
  715. nested to any reasonable depth.
  716.  
  717. Here is a brief list of C-Kermit interactive commands:
  718. @begin(format,spread 0)
  719. @tabclear()@tabset(1.5inches,2.0inches,2.5inches)
  720. @>@q(%)@\  Comment
  721. @>@q(!)@\  Execute an OS/2 command, or start up CMD.EXE.
  722. @>@q(bye)@\  Terminate and log out a remote Kermit server.
  723. @>@q(close)@\  Close a log file.
  724. @>@q(connect)@\  Establish a terminal connection to a remote system.
  725. @>@q(cwd)@\  Change Working Directory.
  726. @>@q(dial)@\  Dial a telephone number.
  727. @>@q(directory)@\  Display a directory listing.
  728. @>@q(echo)@\  Display arguments literally.
  729. @>@q(exit)@\  Exit from the program, closing any open files.
  730. @>@q(finish)@\  Tell remote Kermit server to exit, but not log out.
  731. @>@q(get)@\  Get files from a remote Kermit server.
  732. @>@q(help)@\  Display a help message for a given command.
  733. @>@q(log)@\  Open log file: debugging, packet, session, transaction.
  734. @>@q(quit)@\  Same as 'exit'.
  735. @>@q(receive)@\  Passively wait for files to arrive.
  736. @>@q(remote)@\  Do some file management on a remote Kermit server.
  737. @>@q(script)@\  Execute a login script with a remote system.
  738. @>@q(send)@\  Send files.
  739. @>@q(server)@\  Begin server operation.
  740. @>@q(set)@\  Set various parameters.
  741. @>@q(show)@\  Display values of 'set' parameters.
  742. @>@q(space)@\  Display current disk space usage.
  743. @>@q(statistics)@\  Display statistics about most recent transaction.
  744. @>@q(take)@\  Execute commands from a file.
  745. @end(format)
  746.  
  747. The 'set' parameters are:
  748. @begin(format,spread 0)
  749. @tabclear()@tabset(1.5inches,2.0inches,2.5inches)
  750. @>@q(block-check)@\  Level of packet error detection.
  751. @>@q(delay)@\  How long to wait before sending first packet.
  752. @>@q(duplex)@\  Specify which side echoes during '@q(connect)'.
  753. @>@q(escape-character)@\  Prefix for "escape commands" during '@q(connect)'.
  754. @>@q(file)@\  Set various file parameters.
  755. @>@q(flow-control)@\  Communication line full-duplex flow control.
  756. @>@q(handshake)@\  Communication line half-duplex turnaround character.
  757. @>@q(incomplete)@\  Disposition for incompletely received files.
  758. @>@q(line)@\  Communication line device name.
  759. @>@q(modem-dialer)@\  Type of modem-dialer on communication line.
  760. @>@q(parity)@\  Communication line character parity.
  761. @>@q(prompt)@\  The C-Kermit program's interactive command prompt.
  762. @>@q(receive)@\  Parameters for inbound packets.
  763. @>@q(retry)@\  Packet retransmission limit.
  764. @>@q(send)@\  Parameters for outbound packets.
  765. @>@q(speed)@\  Communication line speed.
  766. @>@q(terminal)@\  Terminal parameters.
  767. @end(format)
  768.  
  769. The 'remote' commands are:
  770. @begin(format,spread 0)
  771. @tabclear()@tabset(1.5inches,2.0inches,2.5inches)
  772. @>@q(cwd)@\  Change remote working directory.
  773. @>@q(delete)@\  Delete remote files.
  774. @>@q(directory)@\  Display a listing of remote file names.
  775. @>@q(help)@\  Request help from a remote server.
  776. @>@q(host)@\  A command to the remote host in its command language.
  777. @>@q(space)@\  Display current disk space usage on remote system.
  778. @>@q(type)@\  Display a remote file on your screen.
  779. @>@q(who)@\  Show who's logged in, or get information about a user.
  780. @end(format)
  781.  
  782. Most of these commands are described adequately in the Kermit User Guide or the
  783. Kermit book.  Special aspects of certain C-Kermit commands are described
  784. below.
  785. @string[STXTBS="@tabclear()@tabset(1.2 inches, 3 inches)"]
  786. @subsection<The 'send' command>
  787. @value(STXTBS)
  788. @begin(format)
  789. Syntax:@\@q<send >@i(fn)
  790. @i(or)@\@q<send >@i(fn1)@q< >@i<rfn1>
  791. @end(format)
  792. Send the file or files denoted by @i(fn) to the other Kermit, which should be
  793. running as a server, or which should have been given the '@q<receive>' command.  Each file
  794. is sent under its own name (as described above, or as specified by the '@q(set
  795. file names)' command).  If the second form of the '@q<send>' command is used, i.e.
  796. with @i(fn1) denoting a single OS/2 file, @i(rfn1) may be specified as a name
  797. to send it under.  The '@q<send>' command may be abbreviated to '@q<s>', even though
  798. '@q<s>' is not a unique abbreviation for a top-level C-Kermit command.
  799.  
  800. The wildcard characters '@q[*]' and '@q[?]' are accepted in
  801. @i(fn).  If '@q[?]' is to be included, it must be prefixed by '@q[^]' to
  802. override its normal function of providing help.  '@q[*]' matches any
  803. string, '@q[?]' matches any single character.  When @i(fn) contains
  804. '@q[*]' or '@q[?]' characters, there is a limit to the number of files
  805. that can be matched, which varies depending on the length of the file
  806. names involved.  If you get the message '@q"Too many files match"' then
  807. you'll have to make a more judicious selection.
  808.  
  809. @subsection<The 'receive' command>
  810. @value(STXTBS)
  811. @begin(format)
  812. Syntax:@\@q<receive>
  813. @i<or>@\@q<receive >@i<fn1>
  814. @end(format)
  815. Passively wait for files to arrive from the other Kermit, which must be given
  816. the '@q<send>' command -- the '@q<receive>' command does not work in conjunction with a
  817. server (use '@q<get>' for that).  If @i(fn1) is specified, store the first incoming
  818. file under that name.  The '@q<receive>' command may be abbreviated to '@q<r>'.
  819. If the second form of the command is given, and @i(fn1) contains a path
  820. specification, then that path must exist -- C-Kermit will not create a
  821. directory for the file. 
  822.  
  823. @subsection<The 'get' command>
  824. @value(STXTBS)
  825. @begin(format)
  826. Syntax:@\@q<get >@i<rfn>
  827. @i<or>@\@q(get)
  828. @\@i(rfn)
  829. @\@i(fn1)
  830. @end(format)
  831. Request a remote Kermit server to send the named file or files.  Since a
  832. remote file specification (or list) might contain spaces, which normally
  833. delimit fields of a C-Kermit command, an alternate form of the command is
  834. provided to allow the inbound file to be given a new name: type '@q<get>' alone
  835. on a line, and you will be prompted separately for the remote and local
  836. file specifications, for example
  837. @Begin(Example)
  838. C-Kermit>@ux(get)
  839.  Remote file specification: @ux(profile exec)
  840.  Local name to store it under: @ux(profile.ibm)
  841. @End(Example)
  842. As with '@q<receive>', if more than one file arrives as a result of the '@q<get>'
  843. command, only the first will be stored under the alternate name given by
  844. @i(fn1); the remaining files will be stored under their own names if possible.
  845. If a '@q[?]' is to be included in the remote file specification, you must
  846. prefix it with '@q[^]' to suppress its normal function of providing help.
  847.  
  848. If you have started a multiline '@q<get>' command, you may escape from its
  849. lower-@|level prompts by typing a carriage return in response to the prompt,
  850. e.g.
  851. @Begin(Example)
  852. C-Kermit>@ux(get)
  853.  Remote file specification: @ux(foo)
  854.  Local name to store it under: @i<(Type a carriage return here)>
  855. (cancelled)
  856. C-Kermit>
  857. @End(Example)
  858.  
  859. @subsection(The 'server' command)
  860.  
  861. The '@q<server>' command places C-Kermit in "server mode" on the currently selected
  862. communication line.  All further commands must arrive as valid Kermit packets
  863. from the Kermit on the other end of the line.  The OS/2 C-Kermit server can
  864. respond to the following commands:
  865. @begin(format,spread 0,above 1,below 1)
  866. @tabclear()@tabset(2.25inches)
  867. @u<Command>@\@ux<Server Response>
  868.   @q(get)@\  Sends files
  869.   @q(send)@\  Receives files
  870.   @q(bye)@\  Attempts to log itself out
  871.   @q(finish)@\  Exits to level from which it was invoked
  872.   @q(remote directory)@\  Sends directory lising
  873.   @q(remote delete)@\  Removes files
  874.   @q(remote cwd)@\  Changes working directory
  875.   @q(remote type)@\  Sends files to your screen
  876.   @q(remote space)@\  Reports about its disk usage
  877.   @q(remote help)@\  Lists these capabilities
  878.   @q(remote host)@\  Execute an OS/2 command
  879. @end(format)
  880. Note that the '@q<remote host>' command should be used with great care.  It should
  881. only be used to invoke OS/2 commands which produce their output through
  882. stdio, and which require no keyboard interaction.  Commands such as
  883. '@q(copy)' and '@q(rename)' are OK (although they may sometimes produce output
  884. on stderr, which will appear on the screen of the OS/2 system).  It is not
  885. possible to use the '@q<remote host>' command to run a word proccessor, for
  886. instance.
  887.  
  888. @subsection(The 'remote', 'bye', and 'finish' commands)
  889.  
  890. C-Kermit may itself request services from a remote Kermit server.  In
  891. addition to '@q<send>' and '@q<get>', the following commands may also be sent from
  892. C-Kermit to a Kermit server:
  893.  
  894. @begin(mydesc)
  895. @q<remote cwd [@i(directory) ]>@*
  896. If the optional remote directory specification is
  897. included, you will be prompted on a separate line for a password, which will
  898. not echo as you type it.  If the remote system does not require a password
  899. for this operation, just type a carriage return.
  900.  
  901. @q<remote delete @i(rfn)>@*
  902. delete remote file or files.
  903.  
  904. @q<remote directory [@i(rfn) ]>@*
  905. directory listing of remote files.
  906.  
  907. @q<remote host @i(command)>@*
  908. issue a command in the remote host's own command language.
  909.  
  910. @q<remote space>@*
  911. disk usage report from the remote host.
  912.  
  913. @q<remote type @i(rfn)>@*
  914. display remote file or files on the screen.
  915.  
  916. @q<remote who [@i(user) ]>@*
  917. display information about who's logged in.
  918.  
  919. @q<remote help>@*
  920. display remote server's capabilities.
  921.  
  922. @q<bye @i(and) finish>@*
  923. When connected to a remote Kermit server, these commands
  924. cause the remote server to terminate; '@q<finish>' returns it to Kermit or system
  925. command level (depending on the implementation or how the program was invoked);
  926. '@q<bye>' also requests it to log itself out.
  927. @end(mydesc)
  928. @subsection(The 'log' and 'close' commands)
  929. @value(STXTBS)
  930. @begin(format)
  931. Syntax:@\@q<log {debugging, packets, session, transactions} [@i(fn1) ]>
  932. @\@q(close {debugging, packets, session, transactions} )
  933. @end(format) 
  934. C-Kermit's progress may be logged in various ways.  The '@q<log>' command
  935. opens a log, the '@q<close>' command closes it.  In addition, all open logs
  936. are closed by the '@q<exit>' and '@q<quit>' commands.  A name may be specified for
  937. a log file; if the name is omitted, the file is created with a default
  938. name as shown below.
  939.  
  940. @begin(mydesc)
  941. @q<log debugging>@*
  942. This produces a voluminous log of the internal workings of
  943. C-Kermit, of use to Kermit developers or maintainers in tracking down suspected
  944. bugs in the C-Kermit program.  Use of this feature dramatically slows down the
  945. Kermit protocol.  Default name: @q(debug.log). @value(NODEBUGLOG)
  946.  
  947. @q<log packets>@*
  948. This produces a record of all the packets that go in and out of
  949. the communication port.  This log is of use to Kermit maintainers who are
  950. tracking down protocol problems in either C-Kermit or any Kermit that
  951. C-Kermit is connected to.  Default name:  @q(packet.log).
  952.  
  953. @q<log session>@*
  954. This log will contain a copy of everything you see on your screen
  955. during the '@q<connect>' command, except for local messages or interaction with
  956. local escape commands.  Default name:  @q(session.log).
  957.  
  958. @q<log transactions>@*
  959. The transaction log is a record of all the files that were
  960. sent or received while transaction logging was in effect.  It includes time
  961. stamps and statistics, filename transformations, and records of any
  962. errors that may have occurred.  The transaction log allows you to have
  963. long unattended file transfer sessions without fear of missing some
  964. vital screen message.  Default name:  @q(transact.log).
  965. @end(mydesc)
  966.  
  967. The '@q<close>' command explicitly closes a log, e.g. '@q<close debug>'.
  968.  
  969. @i<Note:>  Debug and Transaction logs are a compile-time option; C-Kermit may
  970. be compiled without these logs, in which case it will run faster, it will
  971. take up less space on the disk, and the commands relating to them will not
  972. be present.
  973.  
  974. @subsection(Local File Management Commands)
  975. OS/2 Kermit allows some degree of local file management from interactive
  976. command level:
  977.  
  978. @begin(mydesc)
  979. @q<directory [@i(fn) ]>@*
  980. Displays a listing of the names, sizes, and dates of files
  981. matching @i(fn) (which defaults to '@q[*.*]').  Equivalent to '@q(dir)'.
  982.  
  983. @q<cwd @q[directory-name]>@*
  984. Changes Kermit's working directory to the one given.  The directory specification
  985. may be preceeded by a drive specifier, in which case that becomes the current
  986. drive.  This command affects only
  987. the Kermit process and any processes it may subsequently create.
  988.  
  989. @q<space>@*
  990. Display information about disk space and/or quota in the current
  991. directory and device.  Equivalent to '@q(chkdsk)'.
  992.  
  993. @q<! [@i(command) ]>@*
  994. The command is executed by the OS/2 command interpreter CMD.EXE.  If no command
  995. is specified, then CMD.EXE itself is started; terminating it by typing
  996. 'exit' will return you to C-Kermit command level.  Use the '@q(!)' command
  997. to provide file management or other functions not explicitly provided by
  998. C-Kermit commands.  The '@q(!)' command has certain peculiarities:
  999. @begin(itemize,spread 0)
  1000. At least one space must separate the '@q(!)' from the @i(command).
  1001.  
  1002. A '@q(cd)' or '@q(chdir)' (change directory) command executed in this manner will have no effect
  1003. on returning to Kermit -- use the C-Kermit '@q(cwd)' command instead.
  1004. @end(itemize)
  1005. @end(mydesc)
  1006.  
  1007. @subsection(The 'set' Command)
  1008. @value(STXTBS)
  1009. @begin(format)
  1010. Syntax:@\@q<set @i(parameter [parameter] value)>
  1011. @end(format) 
  1012. Since Kermit is designed to allow diverse systems to communicate, it is
  1013. often necessary to issue special instructions to allow the program to adapt
  1014. to peculiarities of the another system or the communication path.  These
  1015. instructions are accomplished by the '@q<set>' command.  The '@q<show>' command may
  1016. be used to display current settings.  Here is a brief synopsis of settings
  1017. available in the current release of C-Kermit:
  1018.  
  1019. @begin(mydesc)
  1020. @q<block-check {1, 2, 3}>@*
  1021. Determines the level of per-packet error detection.
  1022. "1" is a single-@|character 6-bit checksum, folded to include the values of all
  1023. bits from each character.  "2" is a 2-character, 12-bit checksum.  "3" is a
  1024. 3-character, 16-bit cyclic redundancy check (CRC).  The higher the block check,
  1025. the better the error detection and correction and the higher the resulting
  1026. overhead.  Type 1 is most commonly used; it is supported by all Kermit
  1027. implementations, and it has proven adequate in most circumstances.  Types 2 or
  1028. 3 would be used to advantage when transferring 8-bit binary files over noisy
  1029. lines.
  1030.  
  1031. @q<delay @i(n)>@*
  1032. How many seconds to wait before sending the first packet after a
  1033. '@q<send>' command, in remote mode only.  It is irrelevant for OS/2 Kermit, since
  1034. it is always in local mode.
  1035.  
  1036. @q<duplex {full, half}>@*
  1037. For use during '@q<connect>'.  Specifies which side is doing
  1038. the echoing; '@q<full>' means the other side, '@q<half>' means C-Kermit must echo
  1039. typein itself.
  1040.  
  1041. @q<escape-character @i(cc)>@*
  1042. For use during '@q<connect>' to get C-Kermit's attention.
  1043. The escape character acts as a prefix to an 'escape command', for instance to
  1044. close the connection and return to C-Kermit or OS/2 command level.
  1045. The normal escape character is Control-@q<]> (29).
  1046.  
  1047. @q<file {display, names, type, warning}>@*
  1048. Establish various file-related parameters:
  1049.  
  1050. @begin(mydesc)
  1051. @q<display {on, off}>@*
  1052. Normally '@q<on>'; when in local mode, display progress of file
  1053. transfers on the screen (stdout), and listen to the keyboard for
  1054. interruptions.  If '@q<off>' (equivalent to '@q(-q)' on command line)
  1055. none of this is done, and the file transfer may proceed in the
  1056. background oblivious to any other work concurrently done at the console
  1057. terminal. 
  1058.  
  1059. @q<names {converted, literal}>@*
  1060. Normally '@q<converted>, which means that outbound filenames have path
  1061. specifications stripped and non-alphanumeric characters
  1062. changed to @q(X)'s (except for the dot).  '@q<literal>' means that none of these
  1063. conversions are done; therefore, any directory path appearing in a
  1064. received file specification must exist and be write-accessible.
  1065. When literal naming is being used, the sender should not use path
  1066. names in the file specification unless the same path exists on the
  1067. target system and is writable.
  1068.  
  1069. @q<type {binary, text} [{7, 8}]>@*
  1070. @begin<multiple>
  1071. The file type is normally text, which
  1072. means that any control-Z in a file being transmitted is treated as an
  1073. end-of-file mark.  Binary means transmit file contents without
  1074. conversion.  Binary ('@q(-i)' in command line notation) is necessary for
  1075. binary files. 
  1076.  
  1077. The optional trailing parameter tells the bytesize for file transfer. 
  1078. It is 8 by default.  If you specify 7, the high order bit will be
  1079. stripped from each byte of sent and received files.  This is useful for
  1080. transferring text files that may have extraneous high order bits set in
  1081. their disk representation (e.g.  Wordstar or similar word processor
  1082. files).
  1083. @end<multiple>
  1084.  
  1085. @q<warning {on, off}>@*
  1086. Normally '@q(off)', which means that incoming files will silently overwrite
  1087. existing files of the same name.  When '@q(on)' ('@q(-w)' on command line)
  1088. Kermit will check if an arriving file would overwrite an existing file;
  1089. if so, it will construct a new name for the arriving file, of the form
  1090. @q(FZZ)@i(n)@q(.BAR), where @q(FZZ.BAR) is the name they share and @i(n) is
  1091. a "generation number"; if @q(FZZ.BAR) exists, then the new file will be
  1092. called @q(FZZ00001.BAR).  If @q(FZZ.BAR) and @q(FZZ00001.BAR) exist, the
  1093. new file will be @q(FZZ00002.BAR), and so on.  If the common name were
  1094. more than 6 characters long (eg @q(GOODDATA.DAT)), then the new name for the
  1095. arriving file would be @q(GOODD001.DAT) and so on. 
  1096.  
  1097. @begin(quotation)
  1098. @i(CAUTION:)  If Control-F or Control-B is used to cancel an incoming file,
  1099. and a file of the same name previously existed, @i(and) the "file warning"
  1100. feature is not enabled, then the previous copy of the file will disappear.
  1101. @end(quotation)
  1102. @end(mydesc)
  1103.  
  1104. @q<flow-control {none, xon/xoff}>@*
  1105. Normally '@q<xon/xoff>' for full duplex flow control.
  1106. Should be set to '@q<none>' if the other system cannot do xon/xoff flow control, or
  1107. if you have issued a '@q<set handshake>' command.  If set to '@q(xon/xoff)', then
  1108. '@q(handshake)' should be set to '@q(none)'.  This setting applies during both terminal
  1109. connection and file transfer.
  1110.  
  1111. @q<incomplete {discard, keep}>@*
  1112. Disposition for incompletely received files.
  1113. If an incoming file is interrupted or an error occurs during transfer,
  1114. the part that was received so far is normally discarded.  If you '@q(set
  1115. incomplete keep)' then such file fragments will be kept.
  1116.  
  1117. @q<handshake {xon, xoff, cr, lf, bell, esc, none}>@*
  1118. Normally '@q(none)'.  Otherwise,
  1119. half-duplex communication line turnaround handshaking is done, which means
  1120. Kermit will not reply to a packet until it has received the indicated handshake
  1121. character or has timed out waiting for it; the handshake setting applies only
  1122. during file transfer.  If you '@q(set handshake)' to other than '@q(none)', then '@q(flow)'
  1123. should be set to '@q(none)'.
  1124.  
  1125. @q<line [@i(dev) ]>@*
  1126. The device name for the communication line to be used for file transfer and
  1127. terminal connection, e.g. @q(COM2).  If you omit the device name,
  1128. Kermit will revert to its default device, @q(COM1).
  1129.  
  1130. @q<modem-dialer {direct, hayes, racalvadic, ventel, ...}>@*
  1131. The type of modem dialer on the communication line.  '@q(direct)' indicates
  1132. either there is no dialout modem, or that if the line requires carrier
  1133. detection to open, then 'set line' will hang waiting for an incoming
  1134. call.  '@q"hayes"', '@q"ventel"', and the others indicate that '@q<set line>' (or
  1135. the '@q(-l)' argument) will prepare for a subsequent '@q<dial>' command for the
  1136. given dialer.  Support for new dialers is added from time to time, so
  1137. type '@q<set modem ?>' for a list of those supported in your copy of Kermit. 
  1138. See the description of the '@q(dial)' command. 
  1139.  
  1140. @q<parity {even, odd, mark, space, none}>@*
  1141. Specify character parity for use in
  1142. packets and terminal connection, normally '@q(none)'.  If other than '@q(none)', C-Kermit
  1143. will seek to use the 8th-bit prefixing mechanism for transferring 8-bit binary
  1144. data, which can be used successfully only if the other Kermit agrees; if not,
  1145. 8-bit binary data cannot be successfully transferred.
  1146.  
  1147. @q<prompt [@i(string) ]>@*
  1148. The given string will be substituted for '@q(C-Kermit>)' as
  1149. this program's prompt.  If the string is omitted, the prompt will revert to
  1150. '@q(C-Kermit>)'.  If the string is enclosed in double quotes, the quotes will
  1151. be stripped and any leading and trailing blanks will be retained.
  1152.  
  1153. @q<send @i(parameter)>@*
  1154. Establish parameters to use when sending packets.  These will be in effect
  1155. only for the initial packet sent, since the other Kermit may override these
  1156. parameters during the protocol parameter exchange (unless noted below).
  1157.  
  1158. @begin(mydesc)
  1159. @q<end-of-packet @i(cc)>@*
  1160. Specifies the control character needed by the other
  1161. Kermit to recognize the end of a packet.  C-Kermit sends this character at the
  1162. end of each packet.  Normally 13 (carriage return), which most Kermit
  1163. implementations require.  Other Kermits require no terminator at all, still
  1164. others may require a different terminator, like linefeed (10).
  1165.  
  1166. @q<packet-length @i(n)>@*
  1167. Specify the maximum packet length to send.  Normally 90.
  1168. Shorter packet lengths can be useful on noisy lines, or with systems or front
  1169. ends or networks that have small buffers.  The shorter the packet, the higher
  1170. the overhead, but the lower the chance of a packet being corrupted by noise,
  1171. and the less time to retransmit corrupted packets.  This command overrides
  1172. the value requested by the other Kermit during protocol initiation unless the
  1173. other Kermit requests a shorter length.
  1174.  
  1175. @q<pad-character @i(cc)>@*
  1176. Designate a character to send before each packet.
  1177. Normally, none is sent.  Outbound padding is sometimes necessary for
  1178. communicating with slow half duplex systems that provide no other means of
  1179. line turnaround control.  It can also be used to send special characters
  1180. to communications equipment that needs to be put in "transparent" or
  1181. "no echo" mode, when this can be accomplished in by feeding it a certain
  1182. control character.
  1183.  
  1184. @q<padding @i(n)>@*
  1185. How many pad characters to send, normally 0.
  1186.  
  1187. @q<start-of-packet @i(cc)>@*
  1188. The normal Kermit packet prefix is Control-A (1); this
  1189. command changes the prefix C-Kermit puts on outbound packets.  The only
  1190. reasons this should ever be changed would be: Some piece of equipment somewhere
  1191. between the two Kermit programs will not pass through a Control-A; or, some
  1192. piece of of equipment similarly placed is echoing its input.  In the latter
  1193. case, the recipient of such an echo can change the packet prefix for outbound
  1194. packets to be different from that of arriving packets, so that the echoed
  1195. packets will be ignored.  The opposite Kermit must also be told to change the
  1196. prefix for its inbound packets.
  1197.  
  1198. @q<timeout @i(n)>@*
  1199. Specifies the number of seconds you want the other Kermit
  1200. to wait for a packet before timing it out and requesting retransmission.
  1201. Defaults to 10 seconds.
  1202. @end(mydesc)
  1203.  
  1204. @q<receive @i<parameter>>@*
  1205. Establish parameters to request the other Kermit to use when sending packets.
  1206.  
  1207. @begin(mydesc)
  1208. @q<end-of-packet @i(cc)>@*
  1209. Requests the other Kermit to terminate its packets with
  1210. the specified character.
  1211.  
  1212. @q<packet-length @i(n)>@*
  1213. Specify the maximum packet length to that you want the
  1214. other Kermit to send, normally 90.  If you specify a length of 95 or greater,
  1215. then it will be used if the other Kermit supports, and agrees to use, the
  1216. Kermit protocol extension for long packets.  In this case, the maximum length
  1217. depends upon the systems involved, but there would normally be no reason for
  1218. packets to be more than about 1000 characters in length.  The '@q<show
  1219. parameters>' command displays C-Kermit's current and maximum packet lengths.
  1220.  
  1221. @q<pad-character @i(cc)>@*
  1222. C-Kermit normally does not need to have incoming packets
  1223. preceded with pad characters.  This command allows C-Kermit to request the
  1224. other Kermit to use @i(cc) as a pad character.  Default @i(cc) is NUL, ASCII 0.
  1225.  
  1226. @q<padding @i(n)>@*
  1227. How many pad characters to ask for, normally 0.
  1228.  
  1229. @q<start-of-packet @i(cc)>@*
  1230. Change the prefix C-Kermit looks for on inbound
  1231. packets to correspond with what the other Kermit is sending.
  1232.  
  1233. @q<timeout @i(n)>@*
  1234. Normally, each Kermit partner sets its packet timeout interval
  1235. based on what the opposite Kermit requests.  This command allows you to
  1236. override the normal procedure and specify a timeout interval for OS/2 Kermit to
  1237. use when waiting for packets from the other Kermit.  If you specify 0, then no
  1238. timeouts will occur, and OS/2 Kermit will wait forever for expected packets to
  1239. arrive.
  1240. @end(mydesc)
  1241.  
  1242. @q<speed {0, 110, 150, 300, 600, 1200, 2400, 4800, 9600, 19200}>@*
  1243. The baud rate for
  1244. the external communication line.  '@q<set baud>' is a synomym for '@q<set speed>'.
  1245. 19200 baud may not be available, depending on your communications hardware.
  1246.  
  1247. @q<terminal @i(parameter  value)>@*
  1248. Used for specifying terminal parameters.  Currently, '@q<bytesize>' is
  1249. the only parameter provided, and it can be set to 7 or 8.  This controls
  1250. the width of the data path between the console and the remote system when
  1251. C-Kermit is in connect (ie terminal emulation) mode.  It's 7 by default.
  1252. @end(mydesc)
  1253.  
  1254. @subsection(The 'show' Command)
  1255. @value(STXTBS)
  1256. @begin(format)
  1257. Syntax:@\@q<show {parameters, versions}>
  1258. @end(format) 
  1259. The '@q<show>' command with the default argument of '@q<parameters>' displays
  1260. the values of all the '@q<set>' parameters described above.  If you type
  1261. '@q<show versions>', then C-Kermit will display the version numbers and
  1262. dates of all its internal modules.  You should use the '@q<show versions>'
  1263. command to ascertain the vintage of your Kermit program before reporting
  1264. problems to Kermit maintainers.
  1265.  
  1266. @subsection(The 'statistics' Command)
  1267. The statistics command displays information about the most recent Kermit
  1268. protocol transaction, including file and communication line i/o, timing
  1269. and efficiency, as well as what encoding options were in effect (such as
  1270. 8th-bit prefixing, repeat-@|count compression).
  1271.  
  1272. @subsection(The 'take' and 'echo' Commands)
  1273. @value(STXTBS)
  1274. @begin(format)
  1275. Syntax:@\@q<take >@i<fn1>@*
  1276. @\@q<echo >@i<[text to be echoed]>
  1277. @end(format) 
  1278. The '@q<take>' command instructs C-Kermit to execute commands from the named
  1279. file.  The file may contain any interactive C-Kermit commands, including
  1280. '@q<take>'; command files may be nested to any reasonable depth, but it may
  1281. not contain text to be sent to a remote system during the '@q<connect>' command.
  1282. This means that a command file like this:
  1283. @begin(example)
  1284. set speed 9600
  1285. connect
  1286. login myuserid
  1287. mypassword
  1288. @i<etc>
  1289. @end(example)
  1290. will @i(not) send "login myserid" or any of the following text to the remote
  1291. system.  To carry on a canned dialog, use the '@q<script>' command, described
  1292. later.
  1293.  
  1294. The '@q(%)' command is useful for including comments in take-command files.
  1295. It may only be used at the beginning of a line.
  1296.  
  1297. The '@q<echo>' command may be used within command files to issue greetings,
  1298. announce progress, ring the terminal bell, etc.
  1299. This command simply displays its text
  1300. argument (almost) literally at the terminal; the argument may contain octal
  1301. escapes of the form @qq(\ooo), where @q(o) is an octal digit (0-7), and there
  1302. may be 1, 2, or 3 such digits, whose value specify an ASCII character, such as
  1303. @qq(\007) (or @qq(\07) or just @qq(\7)) for beep, @qq(\012) for newline, etc.
  1304.  
  1305. Take-command files are in exactly the same syntax as interactive commands.
  1306. Note that this implies that if you want to include special characters like
  1307. question mark or circumflexes that you would have to quote with @q(^) when
  1308. typing interactive commands, you must quote these characters the same way
  1309. in command files.  Long lines may be continued by ending them with a single
  1310. @q(^).
  1311.  
  1312. Command files may be used in lieu of command macros, which have not been
  1313. implemented in this version of C-Kermit.  For instance, if you commonly
  1314. connect to a system called 'B' that is connected to com2 at 4800 baud,
  1315. you could create a file called @q(b) containing the commands
  1316. @begin(example)
  1317. % C-Kermit command file to connect to System B thru com2
  1318. set line com2
  1319. set speed 4800
  1320. % Beep and give message
  1321. echo \007Connecting to System B...
  1322. connect
  1323. @end(example)
  1324. and then simply type '@q<take b>' (or '@q<t b>' since no other commands begin with
  1325. the letter 't') whenever you wish to connect to system B.  Note the
  1326. comment lines and the beep inserted into the '@q<echo>' command.
  1327.  
  1328. @index<IBM>
  1329. For connecting to IBM mainframes, a number of '@q<set>' commands are required;
  1330. these, too, can be conveniently collected into a '@q<take>' file like this one:
  1331. @begin(example)
  1332. % Sample C-Kermit command file to set up current line
  1333. % for IBM mainframe communication
  1334. %
  1335. set parity mark
  1336. set handshake xon
  1337. set flow-control none
  1338. set duplex half
  1339. @end(example)
  1340.  
  1341. Note that no single command is available to wipe out all of these settings
  1342. and return C-Kermit to its default startup state; to do that, you can either
  1343. restart the program, or else make a command file that executes the necessary
  1344. '@q<set>' commands:
  1345. @begin(example)
  1346. % Sample C-Kermit command file to restore normal settings
  1347. %
  1348. set parity none
  1349. set handshake none
  1350. set flow-control xon/xoff
  1351. set duplex full
  1352. @end(example)
  1353.  
  1354. An implicit '@q<take>' command is executed upon your @q(CKERMIT.INI) file when C-Kermit
  1355. starts up, upon either interactive or command-line invocation.  The @q(CKERMIT.INI)
  1356. file should contain '@q<set>' or other commands you want to be in effect at all
  1357. times.  For instance, you might want override the default action when incoming
  1358. files have the same names as existing files -- in that case, put the command
  1359. @example(set file warning on)
  1360. in your @q(CKERMIT.INI) file.
  1361.  
  1362. Errors encountered during execution of take files (such as failure to complete
  1363. dial or script operations) cause termination of the current take file, popping
  1364. to the level that invoked it (take file, interactive level, or the command
  1365. interpreter).
  1366.  
  1367. You may also use the redirection mechanism to cause
  1368. C-Kermit to execute commands from a file:
  1369. @example(kermit < cmdfile)
  1370. or you can even pipe commands in from another process:
  1371. @example(genkcmds | kermit)
  1372.  
  1373. @subsection(The 'connect' Command)
  1374.  
  1375. The '@q<connect>' command ('@q<c>' is an acceptable non-unique abbreviation)
  1376. links your terminal to another computer as if it were a local
  1377. terminal to that computer, through the device specified in the most recent '@q<set
  1378. line>' command.  All characters you type at your keyboard are sent out the
  1379. communication line (and if you have '@q<set duplex half>', also displayed on your
  1380. screen), and characters arriving at the communication port are displayed on
  1381. the screen.  Current settings of speed, parity, duplex, and flow-@|control are
  1382. honored, and the data connection is 7 bits wide unless you have given the
  1383. command '@q<set terminal bytesize 8>'.  If you have issued a '@q<log session>' command,
  1384. everything you see on your screen will also be recorded to your session log.
  1385. This provides a way to "capture" files from remote systems that don't have
  1386. Kermit programs available.
  1387.  
  1388. To get back to your own system, you must type the escape character, which is
  1389. Control-@|@q<]> (@q(^])) (unless you have changed it with the '@q<set escape>'
  1390. command), followed by a single-@|character command, such as '@q<c>' for "close
  1391. connection".  Single-@|character commands include:
  1392. @begin(description,leftmargin +8,indent -6,spread 0.4)
  1393. @q(c)@\Close the connection
  1394.  
  1395. @q(b)@\Send a BREAK signal for about 1 second
  1396.  
  1397. @q(0)@\(zero) send a null
  1398.  
  1399. @q(?)@\Display help information about these options
  1400.  
  1401. @q(h)@\Hangup the phone
  1402.  
  1403. @q(^])@\Send Control-@q<]> itself (whatever you have defined the
  1404. escape character to be, typed twice in a row sends one copy of it).
  1405. @end(description)
  1406. Uppercase and control equivalents for (most of) these letters are also
  1407. accepted.  A space typed after the escape character is ignored.  Any other
  1408. character will produce a beep.
  1409.  
  1410. In connect mode, C-Kermit emulates a DEC VT102 terminal.  See the section
  1411. "Terminal Emulation" for details of how the emulation works.
  1412.  
  1413. Note that when in interactive command mode, C-Kermit reads its keyboard
  1414. input from stdin and writes its screen output to stdout, allowing command-line
  1415. redirection to be used as described in the previous section.  @comment(This
  1416. isn't quite true, but let's not split hairs.)  However,
  1417. in connect mode, keyboard input is obtained through the KBD subsystem, and
  1418. screen output is through the VIO subsystem.  It is therefore impossible to
  1419. redirect terminal I/O.
  1420.  
  1421. @subsection(The 'dial' command)
  1422. @value(STXTBS)
  1423. Syntax:@\@q(dial )@i(telephone-number-string)
  1424.  
  1425. @index<Modems>@index<Dialout Modems>
  1426. This command controls dialout modems; you should have already issued a '@q<set
  1427. line>' and '@q<set speed>' command to identify the terminal device, and a '@q<set
  1428. modem>' command to identify the type of modem to be used for dialing.  In the
  1429. '@q<dial>' command, you supply the phone number and the Kermit program feeds it to
  1430. the modem in the appropriate format and then interprets dialer return codes and
  1431. modem signals to inform you whether the call was completed.  The
  1432. telephone-@|number-@|string may contain imbedded modem-@|dialer commands, such
  1433. as comma for Hayes pause, or '@q(&)' for Ventel dialtone wait and '@q(%)' for
  1434. Ventel pause (consult your modem manual for details).
  1435.  
  1436. At the time of this writing, support is included for the following modems:
  1437. @begin(itemize,spread 0)
  1438. AT&T 7300 Internal Modem
  1439.  
  1440. Cermetek Info-Mate 212A
  1441.  
  1442. Concord Condor CDS 220
  1443.  
  1444. DEC DF03-AC
  1445.  
  1446. DEC DF100 Series
  1447.  
  1448. DEC DF200 Series
  1449.  
  1450. General DataComm 212A/ED
  1451.  
  1452. Hayes Smartmodem 1200 and compatibles
  1453.  
  1454. Penril
  1455.  
  1456. Racal Vadic
  1457.  
  1458. US Robotics 212A
  1459.  
  1460. Ventel
  1461. @end(itemize)
  1462. A number of these modems are not generally found connected to PCs.  The most
  1463. common modem type used with an OS/2 system is "Hayes compatible".
  1464. Support for new modems is added to the program from time to time; you
  1465. can check the current list by typing '@q<set modem ?>'.
  1466.  
  1467. The device used for dialing out is the one selected in the most recent '@q<set
  1468. line>' command.
  1469.  
  1470. Example:
  1471. @begin(example)
  1472. @tabclear()@tabset(40)
  1473. @ux<kermit -l com1 -b 1200>
  1474. C-Kermit>@ux<set modem-dialer hayes>@\@i(hint: abbreviate) set m h
  1475. C-Kermit>@ux<dial 9,5551212>
  1476. Connected!
  1477. C-Kermit>@ux<connect>@\@i(hint: abbreviate) c
  1478. @i(logon, request remote server, etc.)
  1479. @ux<^]c>@\@i(escape back)
  1480. C-Kermit> ...
  1481. C-Kermit>@ux<quit>@\@i(hint: abbreviate) q
  1482. @end(example)
  1483. this disconnects modem, and hangs up the line.
  1484.  
  1485. @comment[  This is not true at present.
  1486. In general, C-Kermit requires that the modem provide the "carrier detect" (CD)
  1487. signal when a call is in progress, and remove that signal when the call
  1488. completes or the line drops.  If a modem switch setting is available to force
  1489. CD, it should normally not be in that setting.  ]
  1490. C-Kermit requires that the modem track the computer's "data terminal
  1491. ready" (DTR) signal.  If a switch setting is available to simulate DTR
  1492. asserted within the modem, then it should normally not be in that
  1493. setting.  Otherwise the modem will be unable to hang up at the end of a
  1494. call. 
  1495.  
  1496. For Hayes @index<Hayes Modem> dialers, two important switch settings are
  1497. @value(no)1 and @value(no)6.  Switch @value(no)1 should be normally be
  1498. UP so that the modem can act according to your computer's DTR signal. 
  1499. Switch @value(no)6 should normally be UP so carrier-@|detect functions
  1500. properly (but put it DOWN if you have trouble with the UP position). 
  1501. Switches @value(no)2 (English versus digit result codes) and @value(no)4
  1502. (Hayes echoes modem commands) may be in either position. 
  1503.  
  1504. @subsection(The 'script' Command)
  1505. @value(STXTBS)
  1506. Syntax:@\@q(script )@i(expect send [expect send] . . .)
  1507.  
  1508. "expect" has the syntax: @i(expect[-send-expect[-send-expect[...]]])
  1509.  
  1510. The '@q<script>' command carries on a "canned dialog" with a remote system, in
  1511. which data is sent according to the remote system's responses.  The typical use
  1512. is for logging in to a remote system automatically.
  1513.  
  1514. C-Kermit's script facility operates in a manner similar to that commonly
  1515. used by the Unix UUCP system's '@q(L.sys)' file entries.  A login script
  1516. is a sequence of the form:
  1517. @example(@i<expect send [expect send] . . .>)
  1518. where @i(expect) is a prompt or message to be issued by the remote site, and
  1519. @i(send) is the string (names, numbers, etc) to return, and expects are
  1520. separated from sends by spaces.  The send may also be the keyword EOT, to send
  1521. Control-D, or BREAK, to send a break signal.  Letters in sends may be prefixed
  1522. by '@q[~]' to send special characters, including:
  1523. @begin(description,leftmargin +10,indent -10,spread 0)
  1524. @q(~b)@\backspace
  1525.  
  1526. @q(~s)@\space
  1527.  
  1528. @q(~q)@\'@q[?]'(trapped by Kermit's command interpreter)
  1529.  
  1530. @q(~n)@\linefeed
  1531.  
  1532. @q(~r)@\carriage return
  1533.  
  1534. @q(~t)@\tab
  1535.  
  1536. @q(~')@\single quote
  1537.  
  1538. @q(~~)@\tilde
  1539.  
  1540. @q(~")@\double quote
  1541.  
  1542. @q(~x)@\XON (Control-Q)
  1543.  
  1544. @q(~c)@\don't append a carriage return
  1545.  
  1546. @q(~d)@\delay approx 1/3 second during send
  1547.  
  1548. @q(~)@i(o[o[o]])@\an octal character
  1549.  
  1550. @q(~w)@i([d[d]])@\wait specified interval during expect, then time out
  1551. @end(description)
  1552. As with some UUCP systems, sent strings are followed by @q(~r) unless they have
  1553. a @q(~c).
  1554.  
  1555. Only the last 7 characters in each expect are matched.  A null @i(expect),
  1556. e.g. @q(~0) or two adjacent dashes, causes a short delay before proceeding
  1557. to the next send sequence.  A null expect always succeeds.
  1558.  
  1559. As with UUCP, if the expect string does not arrive, the script attempt
  1560. fails.  If you expect that a sequence might not arrive, as with UUCP,
  1561. conditional sequences may be expressed in the form:
  1562. @example(@i<-send-expect[-send-expect[...]]>)
  1563. where dashed sequences are followed as long as previous expects fail.
  1564. Timeouts for expects can be specified using @q(~w); @q(~w) with no
  1565. arguments waits 15 seconds.
  1566.  
  1567. @i(Expect/send) transactions can be easily be debugged by logging
  1568. transactions.  This records all exchanges, both expected and actual.
  1569. The script execution will also be logged in the session log, if that is
  1570. activated.
  1571.  
  1572. Note that '@q[^]' characters in login scripts, as in any other C-Kermit
  1573. interactive commands, must be doubled up.  A line may be ended with a
  1574. single '@q[^]' for continuation.
  1575.  
  1576. Example:
  1577.  
  1578. Using a Hayes-compatible modem, dial up a PAD, simulating pressing CR
  1579. four times to get the '@q(PAD>)' prompt.  (Note how '@q(~0)' stands for a null
  1580. expect string @i(and) for a null send string - ie just send a carriage
  1581. return.) Call a VAX system named 'ERCVAX'.  Get the @q(..name:) prompt, and
  1582. respond with the user name and password.  Notice that the '@q(^)'
  1583. character is used to continue the script command onto the next line. 
  1584. @begin(example)
  1585. set modem hayes
  1586. set line com2
  1587. set baud 1200
  1588. dial 0319871234
  1589. script ~0 ~0 ~0 ~0 ~0 ~0 ~0 ~0 PAD> CALL~sERCVAX ^
  1590. name: SMITH word: SECRET
  1591. @end(example)
  1592. Note that '@q<set line>' is issued @i<after> '@q<set modem>', but @i<before>
  1593. '@q<set baud>' or other line-@|related parameters.  @comment(Why? Is this true
  1594. for OS/2?)
  1595.  
  1596. @subsection(The 'help' Command)
  1597. @value(STXTBS)
  1598. @begin(format)
  1599. Syntax:@\@q(help)
  1600. @i(or)@\@q(help )@i(keyword)
  1601. @i(or)@\@q(help {set, remote} )@i(keyword)
  1602. @end(format)
  1603. Brief help messages or menus are always available at interactive command
  1604. level by typing a question mark at any point.  A slightly more verbose form
  1605. of help is available through the '@q<help>' command.  The '@q<help>' command with
  1606. no arguments prints a brief summary of how to enter commands and how to
  1607. get further help.  '@q<help>' may be followed by one of the top-level C-Kermit
  1608. command keywords, such as '@q<send>', to request information about a command.
  1609. Commands such as '@q<set>' and '@q<remote>' have a further level of help.  Thus you
  1610. may type '@q<help>', '@q<help set>', or '@q<help set parity>'; each will provide a
  1611. successively more detailed level of help.
  1612.  
  1613.  
  1614. @subsection(The 'exit' and 'quit' Commands)
  1615.  
  1616. These two commands are identical.  Both of them do the following:
  1617.  
  1618. @begin(itemize,spread 0)
  1619. Relinquish access to any communication line assigned via '@q<set line>'.
  1620.  
  1621. Hang up the modem, if any, by dropping DTR.
  1622.  
  1623. Close any open logs or other files.
  1624.  
  1625. Exit the program.
  1626. @end(itemize)
  1627. After exit from C-Kermit, your current directory will be the same as when
  1628. you started the program.  The '@q<exit>' command is issued implicitly whenever
  1629. C-Kermit halts normally, e.g. after a command line invocation.
  1630.  
  1631. @newpage
  1632. @section(Terminal Emulation)
  1633.  
  1634. When you issue a '@q(connect)' command the first time after starting Kermit,
  1635. the screen clears and the cursor is positioned at the top left-hand
  1636. corner.  You can log into the remote host computer as normal.  In this
  1637. mode, the PC emulates a DEC VT102 terminal, so any control codes or escape
  1638. sequences received from the host will be actioned appropriately.
  1639.  
  1640. The 25th line on the screen is used as a status line,
  1641. giving the name of the comms port, the current baud rate
  1642. and how to obtain help.
  1643.  
  1644. Some keys on the VT102 keyboard have no direct equivalent on the PC
  1645. keyboard.  The following table shows the mapping which obtains between
  1646. VT102 keys and PC keys.  Note that the @q(Alt) @i(n) combinations use
  1647. the number keys along the top row of the keyboard, not the numeric
  1648. keypad.
  1649.  
  1650. @begin(verbatim)
  1651. @tabclear @tabset(2 inches)@need(22)
  1652. @ux(VT102)@\@ux(IBMPC)
  1653.  
  1654. Delete@\Del
  1655. PF1@\F1
  1656. PF2@\F2
  1657. PF3@\F3
  1658. PF4@\F4
  1659. Keypad 0@\Alt 0
  1660. Keypad 1@\Alt 1
  1661. Keypad 2@\Alt 2
  1662. Keypad 3@\Alt 3
  1663. Keypad 4@\Alt 4
  1664. Keypad 5@\Alt 5
  1665. Keypad 6@\Alt 6
  1666. Keypad 7@\Alt 7
  1667. Keypad 8@\Alt 8
  1668. Keypad 9@\Alt 9
  1669. Keypad minus@\F5 or F6
  1670. Keypad comma@\F7 or F8
  1671. Keypad dot@\F9
  1672. Keypad enter@\F10
  1673. No Scroll@\Home
  1674. @end(verbatim)
  1675.  
  1676. The PC's '@q(Home)' key (equivalent to the VT102 '@q(No Scroll)' key)
  1677. freezes the data on the screen.  It is typically used when listing a
  1678. long file, to prevent information being scrolled off the top of the
  1679. screen.  Note that the Control-S and Control-Q (Xon/Xoff) keys should
  1680. not be used for this purpose if '@q(flow)' is set to '@q(xon/xoff)',
  1681. because they interfere with the correct operation of the comms device
  1682. driver flow control.  When the '@q(Home)' key is pressed, an '@q(xoff)'
  1683. will be sent automatically when the device driver's receive buffer fills
  1684. up, and an '@q(xon)' will be sent as it empties after the '@q(Home)' key
  1685. has been pressed a second time to unfreeze the screen.  All other keys
  1686. are ignored when the screen is frozen.  The status line indicates when
  1687. the emulator is in this state. 
  1688.  
  1689. Information which scrolls off the top of the screen is not in fact lost,
  1690. but is stored in an "extended display buffer", which can be examined by
  1691. pressing the '@q(PgUp)' key.  The extended display buffer can contain a number
  1692. of screenfulls of data, and the '@q(PgUp)' and '@q(PgDn)' keys can be used to
  1693. range freely through this data.  If any other key is pressed while the
  1694. extended display buffer is visible, the current screen contents are 
  1695. redisplayed and the keystroke is sent to the host.  The '@q(PgUp)' and '@q(PgDn)'
  1696. keys may be used even when the host is still sending data.  If Xon/Xoff flow
  1697. control is in effect, no data will be lost.
  1698.  
  1699. The following VT102 features are not implemented:
  1700. @begin(itemize)
  1701. Smooth scrolling
  1702.  
  1703. 132-column mode
  1704.  
  1705. Alternate character ROM
  1706.  
  1707. LED lamps
  1708. @end(itemize)
  1709. The VT102 keyboard autorepeat mode is always enabled. 
  1710.  
  1711. When in connect mode, typing the escape character (Control-@q(])) followed by
  1712. a @q<?> for help will display a "pop-up" help window, indicating the options
  1713. available.  These options are detailed in the section on the connect
  1714. command.  If @q(^]c) is typed to close the connection, the screen is restored
  1715. to its state when the '@q(connect)' command was issued.  A subsequent
  1716. '@q(connect)' will re-display the VT102 screen.
  1717.  
  1718. The control codes and escape sequences recognised by the VT102 emulation
  1719. are listed below.  For full details of the effects of these codes, please
  1720. consult the VT102 manual.
  1721.  
  1722. @begin(verbatim)
  1723. @tabclear @tabset(1.4 inches,2 inches)
  1724. ENQ@\5@\Send answerback message "OS/2 Kermit"
  1725. BEL@\7@\Sound beep
  1726. BS@\8@\Cursor left
  1727. TAB@\9@\Cursor to next tab stop
  1728. LF@\10@\Cursor down
  1729. VT@\11@\As LF
  1730. FF@\12@\As LF
  1731. CR@\13@\Cursor to left margin
  1732. SO@\14@\Select G1 character set
  1733. SI@\15@\Select G0 character set
  1734. CAN@\24@\Cancel escape sequence
  1735. SUB@\26@\As CAN
  1736. ESC@\26@\See below
  1737. Others@\@\Ignored
  1738.  
  1739. ESC 7@\Save cursor position
  1740. ESC 8@\Restore cursor position
  1741. ESC D@\Index
  1742. ESC E@\Next line
  1743. ESC H@\Set tab at current column
  1744. ESC M@\Reverse index
  1745. ESC Z@\Identify terminal
  1746. ESC c@\Reset
  1747. ESC =@\Enter application keypad mode
  1748. ESC >@\Exit application keypad mode
  1749. ESC @hash() 3@\Double height and width emulation - top half of line
  1750. ESC @hash() 4@\Double height and width emulation - bottom half of line
  1751. ESC @hash() 5@\Single height and width
  1752. ESC @hash() 6@\Single height and double width emulation
  1753. ESC @hash() 8@\Screen alignment display
  1754. ESC ( @i(g)@\G0 designator - @i(g) = A,B or 0 only
  1755. ESC ) @i(g)@\G1 designator - @i(g) = A,B or 0 only
  1756. ESC [ @i(Pn) A@\Cursor up
  1757. ESC [ @i(Pn) B@\Cursor down
  1758. ESC [ @i(Pn) C@\Cursor right
  1759. ESC [ @i(Pn) D@\Cursor left
  1760. ESC [ @i(Pl) ;@i(Pc) H@\Direct cursor address
  1761. ESC [ @i(Pl) ;@i(Pc) f@\Direct cursor address
  1762. ESC [ @i(Pn) c@\Identify report - response is ESC [ ? 6 ; 2 c
  1763. ESC [ 3 g@\Clear all tabs
  1764. ESC [ 0 g@\Clear tabs at current column
  1765. ESC [ ? @i(Pn) h@\Set DEC private mode - modes supported as shown below
  1766. ESC [ ? @i(Pn) l@\Reset DEC private mode - modes supported as shown below
  1767.  
  1768.     mode no.        mode            set           reset
  1769.  
  1770.         1           Cursor key      Application   Cursor
  1771.         2           ANSI/VT52       N/A           VT52
  1772.         5           Screen          Reverse       Normal
  1773.         6           Origin          Relative      Absolute
  1774.         7           Wraparound      On            Off
  1775.  
  1776. ESC [ @i(Pn) h@\Set mode - modes supported as shown below
  1777. ESC [ @i(Pn) l@\Reset mode - modes supported as shown below
  1778.  
  1779.     mode no.        mode            set           reset
  1780.  
  1781.         2           Keyboard lock   On            Off
  1782.         4           Insert          Insert        Replace
  1783.        20           Newline         CR LF         CR
  1784.  
  1785. ESC @i(Pn) i@\Printer/screen on/off - 4 to 7 supported
  1786. ESC [ 5 n@\Status report
  1787. ESC [ 6 n@\Cursor position report
  1788. ESC [ @i(Pn) x@\Request terminal parameter
  1789. ESC [ @i(Pn) ;@i(Pn) r@\Set top and bottom margins
  1790. ESC [ 0 J@\Erase to end of screen
  1791. ESC [ 1 J@\Erase from beginning of screen
  1792. ESC [ 2 J@\Erase all of screen
  1793. ESC [ 0 K@\Erase to end of line
  1794. ESC [ 1 K@\Erase from beginning of line
  1795. ESC [ 2 K@\Erase all of line
  1796. ESC [ @i(Pn) L@\Insert blank lines
  1797. ESC [ @i(Pn) M@\Delete lines
  1798. ESC [ @i(Pn) @@@\Insert blank characters
  1799. ESC [ @i(Pn) P@\Delete characters
  1800. ESC [ @i(Ps) ;@i(Ps) ; ..;@i(Ps) m@\Character attributes or
  1801. ESC [ @i(Ps) ;@i(Ps) ; ..;@i(Ps) }@\Character attributes, as below:
  1802. 0       Default settings
  1803. 1       High intensity
  1804. 4       Underline
  1805. 5       Blink
  1806. 7       Reverse
  1807. 8       Invisible
  1808. 30-37   sets foreground colour to be as shown
  1809.         30      black
  1810.         31      red
  1811.         32      green
  1812.         33      yellow
  1813.         34      blue
  1814.         35      magenta
  1815.         36      cyan
  1816.         37      white
  1817. 40-47   sets background colour to be as shown
  1818.         40      black
  1819.         41      red
  1820.         42      green
  1821.         43      yellow
  1822.         44      blue
  1823.         45      magenta
  1824.         46      cyan
  1825.         47      white
  1826. @end(verbatim)
  1827. Note that the default character set for both G0 and G1 is '@q(A)', ie the UK
  1828. character set.
  1829.  
  1830. The following escape sequences are recognised when the emulator is put into
  1831. VT52 mode by receiving the sequence @q(ESC [ ? 2 l).
  1832.  
  1833. @begin(verbatim)
  1834. ESC A@\Cursor up
  1835. ESC B@\Cursor down
  1836. ESC C@\Cursor right
  1837. ESC D@\Cursor leftup
  1838. ESC F@\Enter graphics mode
  1839. ESC G@\Exit graphics mode
  1840. ESC H@\Cursor to home
  1841. ESC I@\Reverse line feed
  1842. ESC J@\Erase to end of screen
  1843. ESC K@\Erase to end of line
  1844. ESC Y @i(l c)@\Direct cursor address
  1845. ESC Z@\Identify
  1846. ESC =@\Enter application keypad mode
  1847. ESC >@\Exit application keypad mode
  1848. ESC <@\Enter ANSI mode
  1849. @end(verbatim)
  1850. The escape sequences below are accepted but ignored.
  1851. @begin(verbatim)
  1852. ESC O @i(x)@\where @i(x) is any character
  1853. ESC ? @i(x)@\where @i(x) is any character
  1854. ESC [ @i(Pn) q@\Load LEDs
  1855. @end(verbatim)
  1856.  
  1857. @newpage
  1858. @section(C-Kermit Restrictions and Known Bugs)
  1859.  
  1860. If you find any bugs which are not documented here, please send details to
  1861. the author:
  1862. @tabclear @tabset(1 inch)
  1863. @begin(format)
  1864. @\Dr C J Adie
  1865. @\Edinburgh University Computing Service
  1866. @\Main Library
  1867. @\George Square
  1868. @\Edinburgh
  1869. @\EH8 9LJ
  1870. @\United Kingdom
  1871. @end(format)
  1872. or (preferably) by electronic mail on the Janet network to:
  1873. @q(C.J.Adie@@UK.AC.EDINBURGH)
  1874.  
  1875. @begin(enumerate, spread 1)
  1876. @ux(Server breakout):
  1877. There is no way of stopping server operation from the keyboard, short of
  1878. Control-Break.
  1879.  
  1880. @ux(Debugging log):
  1881. There is very little debugging information logged from the OS/2-specific
  1882. parts of the program (it was developed using Codeview).
  1883.  
  1884. @ux(Set Delay):
  1885. This should default to zero.  Currently it has no effect.
  1886.  
  1887. @ux(Dial):
  1888. The @q(DIAL) appears not to work.  The author has no convenient access
  1889. to a dial-out modem, so is not able to test it out properly.  It is
  1890. impossible to terminate the dialling process short of pressing
  1891. Control-Break. 
  1892.  
  1893. @ux(Keyboard handling):
  1894. In interactive command mode (as opposed to connect mode), the keyboard has only
  1895. the natural key-to-ascii-code mapping.  This means that (for instance) the
  1896. Del key does not produce code 127, but a code of 0 followed by 224.  A keyboard
  1897. remapping feature (perhaps incorporating key macros) would be useful in many
  1898. ways.
  1899. @blankspace(1)
  1900. In connect mode, it would be more logical to use the @q(Scroll Lock)
  1901. key as the equivalent of the VT102 @q(No Scroll) key, but this means writing
  1902. a keyboard monitor, as @q(Scroll Lock) is not placed in the keyboard input
  1903. buffer.
  1904.  
  1905. @ux(Terminal emulation):
  1906. If the host sends the escape sequence to put the terminal into 132-column mode,
  1907. and subsequently sends data which would appear in the rightmost 52 columns,
  1908. this may mess up the existing data on the screen.  Really the emulator
  1909. should ignore any data for these columns.
  1910.  
  1911. @ux(Answerback):
  1912. We should have a '@q(set terminal answerback ...)' command to let us change
  1913. the VT102 answerback message.
  1914.  
  1915. @ux(Character set):
  1916. We should have a '@q(set terminal characterset)' to allow the default character
  1917. set to be either the UK or the US set.  At present, the default is UK.
  1918.  
  1919. @ux(File type):
  1920. The way Control-Z is handled could be better.  There should be no '@q(set file
  1921. type {binary, text})'; instead we want a '@q(set ctrlz {on, off})' rather like
  1922. Kermit-MS.  A better display of progress of a transfer is needed, and the
  1923. interrupt keystrokes should conform to the usual Kermit conventions.
  1924.  
  1925. @ux(Hangup):
  1926. There should be a '@q(hangup)' command (as well as the @q(^]h) escape
  1927. sequence), which would drop DTR and RTS, thus hanging up a call through
  1928. a modem.
  1929.  
  1930. @ux(Login Scripts):
  1931. The present login scripts implementation follows the Unix conventions of
  1932. UUCP's '@q(L.sys)' file, rather than the normal Kermit 'INPUT/@|OUTPUT'
  1933. style. 
  1934.  
  1935. @end(enumerate)
  1936.  
  1937. @appendix(Invoking C-Kermit from Another Program)
  1938.  
  1939. If you are writing a communications program and wish to incorporate the Kermit
  1940. protocol within it, one way is to use the OS/2 function call @q(DosExecPgm) to
  1941. call up C-Kermit.  You would supply the instructions for Kermit using
  1942. command-line options, and Kermit would do the transfer, returning back to your
  1943. program when it had finished.
  1944.  
  1945. The only problem with this scenario is that you might already have opened up 
  1946. the COM port within your program, so that when Kermit tries to do the same it
  1947. gets an error code back from @q(DosOpen).  The @q(-u) command line option
  1948. gets round this problem.  It uses the fact that a child process inherits the
  1949. open file handles of its parent.  @q(-u) takes one numeric parameter which is
  1950. the handle of the COM port in question, and it must occur in front of any other
  1951. command-line parameter which accesses the COM port.  The following is a
  1952. complete C program written using the Microsoft C compiler version 5.1 and the
  1953. Microsoft OS/2 Software Development Toolkit, which illustrates how to use the
  1954. @q(-u) command-line option.
  1955.  
  1956. @begin(verbatim)
  1957. @hash()define    INCL_BASE
  1958. @hash()include <os2.h>
  1959. /*
  1960.  *    Example of how to use the C-Kermit -u option to invoke
  1961.  *    Kermit from another program under OS/2.
  1962.  */
  1963. main(int argc, char *argv[]) {
  1964. HFILE    ttyfd;
  1965. USHORT    action;
  1966. int    err,i;
  1967. char    failname[80];
  1968. char    args[80];
  1969. RESULTCODES    res;
  1970. struct dcb {            /* Device control block */
  1971.     USHORT write_timeout;
  1972.     USHORT read_timeout;
  1973.     BYTE flags1, flags2, flags3;
  1974.     BYTE error_replacement;
  1975.     BYTE break_replacement;
  1976.     BYTE xon_char;
  1977.     BYTE xoff_char;
  1978. } ttydcb;
  1979.  
  1980.     /*** Open a file ***/
  1981.     if (err=DosOpen(argv[1],&ttyfd,&action,0L,0,1,0x0012,0L)) {
  1982.         printf("Error %d opening %s\n",err,argv[1]);
  1983.         exit(1);
  1984.     }
  1985.     if (err=DosDevIOCtl(&ttydcb,NULL,0x0073,1,ttyfd)) {
  1986.         printf("Error %d from IOCTL on %s\n",err,argv[1]);
  1987.             exit(1);
  1988.     }
  1989.     ttydcb.flags3 &= 0xF9;
  1990.     ttydcb.flags3 |= 0x04;    /* Read "some" data from line */
  1991.     DosDevIOCtl(NULL,&ttydcb,0x0053,1,ttyfd);
  1992.  
  1993.     /*** Call kermit ***/
  1994.     strcpy(args,"ckoker");
  1995.     i = strlen(args);
  1996.     args[i++]=0;
  1997.     sprintf(&args[i],"-u %d -q -s test.c",ttyfd);
  1998.     i += strlen(&args[i]);
  1999.     args[i++]=0;
  2000.     args[i++]=0;
  2001.     if (err=DosExecPgm(failname,80,EXEC_SYNC,args,NULL,&res,
  2002.                             "KERMIT.EXE")) {
  2003.         printf("Error %d executing Kermit\n",err);
  2004.         exit(1);
  2005.     }
  2006.     
  2007.     /*** Print out return code ***/
  2008.     printf("Termination code %d\n",res.codeTerminate);
  2009.     printf("Result code %d\n",res.codeResult);
  2010.  
  2011.     /*** Close the file ***/
  2012.     if (err=DosClose(ttyfd)) {
  2013.         printf("Error %d closing %s\n",err,argv[1]);
  2014.     }
  2015. }
  2016. @end(verbatim)
  2017. @end(text)
  2018.