home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 3 Comm / 03-Comm.zip / CK5A188.ZIP / ckoker.doc < prev    next >
Text File  |  1993-01-25  |  84KB  |  1,864 lines

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