home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / old / ckermit4f / ckuker.doc < prev    next >
Text File  |  2020-01-01  |  108KB  |  2,298 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.                               C-KERMIT USER GUIDE
  18.  
  19.  
  20.                 FOR UNIX, VMS, AND MANY OTHER OPERATING SYSTEMS
  21.  
  22.                                 Version 4F(085)
  23.  
  24.                             C. Gianone, F. da Cruz
  25.  
  26.               Columbia University Center for Computing Activities
  27.                            New York, New York 10027
  28.  
  29.  
  30.                                  July 14, 1989
  31.  
  32.  
  33.  
  34.                             Copyright (C) 1981,1989
  35.             Trustees of Columbia University in the City of New York
  36.  
  37.      Permission is granted to any individual or institution to use, copy,
  38.     or redistribute this document so long as it is not sold for profit, and
  39.                   provided this copyright notice is retained.
  40. 1. UNIX KERMIT
  41.  
  42. ********
  43. This document is formatted as an ordinary, plain text ASCII disk file.  Typeset
  44. copies are available  in  the  Kermit  User  Guide  from  Columbia  University.
  45. Changes should be made to CKUKER.MSS.
  46. ********
  47.  
  48. Program:    Frank  da  Cruz,  Bill Catchings, Jeff Damens, Columbia University;
  49.             Herm Fischer, Encino CA; contributions by many others.
  50. Language:   C
  51. Documentation:
  52.             Christine Gianone, Frank da Cruz
  53. Version:    4F(085)
  54. Date:       July 14, 1989
  55.  
  56. C-Kermit is an implementation of Kermit, written modularly and transportably in
  57. C. The protocol state transition table is written in wart, a  (non-proprietary)
  58. lex-like  preprocessor for C. System-dependent primitive functions are isolated
  59. into separately compiled modules so that the program should be easily  portable
  60. among  Unix systems and also to non-Unix systems that have C compilers, such as
  61. VAX/VMS, Data General AOS/VS, Apollo Aegis, OS/2, the Apple Macintosh, and  the
  62. Commodore  Amiga.    This document applies to Unix implementations of C-Kermit,
  63. and in most ways also to the VMS, Data General, and other implementations.
  64.  
  65.  
  66. Unix Kermit Capabilities At A Glance:
  67.  
  68.   Local operation:                   Yes
  69.   Remote operation:                  Yes
  70.   Login scripts:                     Yes (UUCP style)
  71.   Transfer text files:               Yes
  72.   Transfer binary files:             Yes
  73.   Wildcard send:                     Yes
  74.   File transfer interruption:        Yes
  75.   Filename collision avoidance:      Yes
  76.   Can time out:                      Yes
  77.   8th-bit prefixing:                 Yes
  78.   Repeat count prefixing:            Yes
  79.   Alternate block checks:            Yes
  80.   Terminal emulation:                Yes
  81.   Communication settings:            Yes
  82.   Transmit BREAK:                    Yes (most versions)
  83.   Support for dialout modems:        Yes
  84.   IBM mainframe communication:       Yes
  85.   Transaction logging:               Yes
  86.   Session logging (raw download):    Yes
  87.   Debug logging:                     Yes
  88.   Packet logging:                    Yes
  89.   Act as server:                     Yes
  90.   Talk to server:                    Yes
  91.   Advanced server functions:         Yes
  92.   Local file management:             Yes
  93.   Command/Init files:                Yes
  94.   UUCP and multiuser line locking:   Yes
  95.   Long packets:                      Yes
  96.   Sliding Windows:                   No
  97.   File attributes packets:           Yes
  98.   Command macros:                    No
  99.   Raw file transmit:                 Yes
  100.  
  101. All numbers in the C-Kermit documentation are decimal unless noted otherwise.
  102.  
  103. C-Kermit provides traditional Unix command line operation  as  well  as  inter-
  104. active  command  prompting and execution.  The command line options provide ac-
  105. cess to a basic subset of C-Kermit's capabilities; the interactive command  set
  106. is far richer.
  107.  
  108. On  systems  with  dialout  modems,  C-Kermit's command file, DIAL command, and
  109. login script facilities  provide  a  counterpart  to  UUCP  (Unix-to-Unix  Copy
  110. Program)  for  file  transfer  with  including  the use of scheduled (e.g. late
  111. night) unattended operation.  UUCP can only be used between computers that sup-
  112. port  UUCP,  but  C-Kermit  can  be used to transfer files with the much larger
  113. variety of computers that have Kermit (or even with computers that  don't  have
  114. Kermit, if you use C-Kermit's "raw" uploading and downloading features).
  115.  
  116.  
  117. 1.1. The Unix File System
  118.  
  119. Consult  your  Unix manual for details about the file system under your version
  120. of Unix.  In general, Unix files have lowercase names, possibly containing  one
  121. or  more  dots  or  other special characters.  Unix directories are tree-struc-
  122. tured.  Directory levels are separated by slash ("/") characters.  For example,
  123.  
  124.     /usr/cmg/bar
  125.  
  126. denotes the file bar in the directory /usr/cmg.  Alphabetic case is significant
  127. in Unix file and directory names, i.e. "a" is a different file  (or  directory)
  128. from "A".  Wildcard or "meta" characters allow groups of files to be specified.
  129. "*" matches any string; "?" matches any single  character;  tilde  "~"  at  the
  130. beginning  of  a  file specification matches the user's home directory, or fol-
  131. lowed immediately by another username, that user's home directory.
  132.  
  133. When C-Kermit is invoked with file arguments  specified  on  the  Unix  command
  134. line,  the  Unix  shell  (Bourne Shell, C-Shell, K-Shell, etc) expands the meta
  135. characters itself, and in this case a wider variety may be available.  For  ex-
  136. ample,
  137.  
  138.     kermit -s ~/ck[uvm]*.{upd,bwr}]
  139.  
  140. is  expanded by the Berkeley C-Shell into a list of all the files in the user's
  141. home directory (~/) that start with the characters "ck", followed by  a  single
  142. character  "u", "v", or "m", followed by zero or more characters, followed by a
  143. dot, followed by one of the strings "upd" or "bwr".  Internally,  the  C-Kermit
  144. program itself expands only the "~", "*", and "?" meta characters.
  145.  
  146. Unix  files are linear (sequential) streams of 8-bit bytes.  Text files consist
  147. streams of ASCII characters (or characters in other codes) with lines separated
  148. by  the Unix newline character, which is linefeed (LF, ASCII 10).  This distin-
  149. guishes Unix text files from those on most other ASCII systems, in which  lines
  150. are  separated  by a carriage-return linefeed sequence (CRLF, ASCII 13 followed
  151. by ASCII 10).  Binary files are likely to contain data in the high bits of  the
  152. file bytes, and have no particular line or record structure.
  153.  
  154. When  transferring  files,  C-Kermit  will convert between upper and lower case
  155. filenames and between LF and CRLF line terminators automatically,  unless  told
  156. to  do otherwise.  When binary files must be transferred, the program should be
  157. instructed not to perform LF/CRLF conversion (-i on the command  line  or  "set
  158. file type binary" interactively; see below).
  159.  
  160.  
  161. 1.2. File Transfer
  162.  
  163. If  C-Kermit  is  in  local mode, the screen (stdout) is continously updated to
  164. show the progress of the file transer.  A dot is printed for  every  four  data
  165. packets, other packets are shown by type:
  166.  
  167.     I Exchange Parameter Information
  168.     R Receive Initiate
  169.     S Send Initiate
  170.     A Attribute packet
  171.     F File Header
  172.     G Generic Server Command
  173.     C Remote Host Command
  174.     N Negative Acknowledgement (NAK)
  175.     E Fatal Error
  176.     T Indicates a timeout occurred
  177.     Q Indicates a damaged, undesired, or illegal packet was received
  178.     % Indicates a packet was retransmitted
  179.  
  180. You may type the following "interrupt" commands during file transfer:
  181.  
  182.     Control-F:  Interrupt the current File, and go on to the next (if any).
  183.     Control-B:  Interrupt the entire Batch of files, terminate the transaction.
  184.     Control-R:  Resend the current packet
  185.     Control-A:  Display a status report for the current transaction.
  186.  
  187. These  interrupt characters differ from the ones used in other Kermit implemen-
  188. tations to avoid conflict with commonly used Unix shell  interrupt  characters.
  189. With  Version  7,  System  III, and System V implementations of Unix, interrupt
  190. commands must be preceeded by the 'connect'  escape  character  (e.g.  normally
  191. Ctrl-\).   Ctrl-F and Ctrl-B are effective only during the transfer of data (D)
  192. packets, and cannot be used to interrupt a transfer that has  not  yet  reached
  193. that stage.
  194.  
  195.     CAUTION:  If Control-F or Control-B is used to cancel an incoming file,
  196.     and a file of the same name previously existed, and the "file  warning"
  197.     feature  is  not  enabled, then the previous copy of the file will dis-
  198.     appear.
  199.  
  200. EMERGENCY EXIT:  When running Unix Kermit in remote mode, if you have started a
  201. protocol operation (sending or receiving a file, server command wait, etc), you
  202. will not be able to communicate with the terminal in the normal way.   In  par-
  203. ticular,  you  cannot  stop  the  protocol  by typing the normal Unix interrupt
  204. characters, since the terminal has been put in "raw mode".    If  you  need  to
  205. regain  control  quickly  -- for instance, because the protocol is stuck -- you
  206. can type two Control-C's directly to the Unix Kermit program  ("connect"  first
  207. if necessary):
  208.  
  209.     Control-C Control-C
  210.  
  211. This will cause the program to display,
  212.  
  213.     ^C^C...
  214.  
  215. exit, and restore the terminal to normal.
  216.  
  217.  
  218. 1.3. Command Line Operation
  219.  
  220. The  C-Kermit command line syntax conforms to the Proposed Syntax Standards for
  221. Unix System Commands put forth by Kathy Hemenway and Helene  Armitage  of  AT&T
  222. Bell Laboratories in Unix/World, Vol.1, No.3, 1984.  The rules that apply are:
  223.  
  224.    - Command names must be between 2 and 9 characters ("kermit" is 6).
  225.    - Command names must include lower case letters and digits only.
  226.    - An option name is a single character.
  227.    - Options are delimited by '-'.
  228.    - Options  with  no  arguments  may  be  grouped  (bundled)  behind one
  229.      delimiter.
  230.    - Option-arguments cannot be optional.
  231.    - Arguments immediately follow options, separated by whitespace.
  232.    - The order of options does not matter.
  233.    - '-' preceded and followed by whitespace means standard input.
  234.  
  235. A group of bundled options may end with an option that has an argument.
  236.  
  237. The following notation is used in command descriptions:
  238.  
  239. fn      A Unix file specification, possibly containing the  "wildcard"  charac-
  240.         ters  `*'  or  `?' (`*' matches all character strings, `?'  matches any
  241.         single character).
  242.  
  243. fn1     A Unix file specification which may not contain `*' or `?'.
  244.  
  245. rfn     A remote file specification in the remote system's  own  syntax,  which
  246.         may denote a single file or a group of files.
  247.  
  248. rfn1    A remote file specification which should denote only a single file.
  249.  
  250. n       A decimal number between 0 and 94.
  251.  
  252. c       A  decimal  number between 0 and 127 representing the value of an ASCII
  253.         character.
  254.  
  255. cc      A decimal number between 0 and 31, or else  exactly  127,  representing
  256.         the value of an ASCII control character.
  257.  
  258. [ ]     Any field in square braces is optional.
  259.  
  260. {x,y,z} Alternatives are listed in curly braces.
  261.  
  262. C-Kermit  command  line options may specify any combination of actions and set-
  263. tings.  If C-Kermit is invoked with a command line that specifies  no  actions,
  264. then  it  will  issue  a  prompt  and begin interactive dialog.  Action options
  265. specify either protocol transactions or terminal connection.
  266.  
  267. An implicit 'take' command is executed upon your  .kermrc  file  when  C-Kermit
  268. starts  up,  upon either interactive or command-line invocation.  This file may
  269. contain C-Kermit interactive-mode commands, which are explained later.
  270.  
  271. -s fn   Send the specified file or files.    If  fn  contains  wildcard  (meta)
  272.         characters,  the  Unix  shell expands it into a list.  fn may also be a
  273.         list of files, as in:
  274.  
  275.             kermit -s ckcmai.c ckuker.h mail.txt
  276.  
  277.         If fn is '-' then kermit sends from standard input, which may come from
  278.         a file:
  279.  
  280.             kermit -s - < foo.bar
  281.  
  282.         or a parallel process:
  283.  
  284.             ls -l | grep cmg | kermit -s -
  285.  
  286.         You  cannot use this mechanism to send terminal typein.  If you want to
  287.         send a file whose actual name is "-" you can precede  it  with  a  path
  288.         name, as in
  289.  
  290.             kermit -s ./-
  291.  
  292. -r      Receive a file or files.  Wait passively for files to arrive.
  293.  
  294. -k      Receive  (passively)  a file or files, sending them to standard output.
  295.         This option can be used in several ways:
  296.  
  297.         kermit -k
  298.             Displays  the  incoming  files  on  your screen; to be used only in
  299.             "local mode" (see below).
  300.  
  301.         kermit -k > fn1
  302.             Sends  the  incoming file or files to the named file, fn1.  If more
  303.             than one file arrives,  all  are  concatenated  together  into  the
  304.             single file fn1.
  305.  
  306.         kermit -k | command
  307.             Pipes the incoming data (single or multiple files) to the indicated
  308.             command, as in
  309.  
  310.                 kermit -k | sort > sorted.stuff
  311.  
  312. -a fn1  If you have specified a file transfer option, you may give an alternate
  313.         name for a single file with the -a ("as") option.  For example,
  314.  
  315.             kermit -s foo -a bar
  316.  
  317.         sends the file foo telling the receiver that its name is bar.  If  more
  318.         than  one  file  arrives or is sent, only the first file is affected by
  319.         the -a option:
  320.  
  321.             kermit -ra baz
  322.  
  323.         stores the first incoming file under the name baz.
  324.  
  325. -x      Begin server operation.  May be used in either local or remote mode.
  326.  
  327. Before proceeding, a few words about remote and local operation are  necessary.
  328. C-Kermit  is  "local"  if it is running on PC or workstation that you are using
  329. directly, or if it is running on a multiuser system and transferring files over
  330. an  external  communication line -- not your job's controlling terminal or con-
  331. sole.  C-Kermit is remote if it is running on a multiuser system and  transfer-
  332. ring  files  over  its  own controlling terminal's communication line (normally
  333. /dev/tty), connected to your PC or workstation.
  334.  
  335. If you are running C-Kermit on a PC, it is normally used in  local  mode,  with
  336. the  "back  port" designated for file transfer and terminal connection, and the
  337. keyboard and screen available to control or interrupt the file transfer and  to
  338. display  its  status.  If you are running C-Kermit on a multiuser (timesharing)
  339. system, it is in remote mode unless you explicitly point it at an external line
  340. for  file  transfer  or  terminal connection.  The following command determines
  341. whether C-Kermit is in local or remote mode:
  342.  
  343. -l dev  Line -- Specify a terminal line to use for file transfer  and  terminal
  344.         connection, as in
  345.  
  346.             kermit -l /dev/ttyi5
  347.  
  348. When an external line is being used, you will also need some additional options
  349. for successful communication with the remote system:
  350.  
  351. -b n    Baud -- Specify the transmission speed in bits per second ("baud rate")
  352.         for the line given in the -l option, as in:
  353.  
  354.             kermit -l /dev/ttyi5 -b 9600
  355.  
  356.         This  option  should  always  be included with the -l option, since the
  357.         speed of an external line is not necessarily what you expect.
  358.  
  359. -p x    Parity -- e,o,m,s,n (even, odd, mark, space, or none).   If  parity  is
  360.         other than none, then Kermit's 8th-bit prefixing mechanism will be used
  361.         for transferring  8-bit  binary  data,  provided  the  opposite  Kermit
  362.         agrees.  The default parity is none.
  363.  
  364. -t      Specifies  half  duplex,  line  turnaround  with  XON  as the handshake
  365.         character.
  366.  
  367. The following commands may be used only with a C-Kermit which is in local mode.
  368.  
  369. -g rfn  Actively request a remote server to send the named file or  files;  rfn
  370.         is a file specification in the remote host's own syntax.  If fn happens
  371.         to contain any special shell characters, like  space,  '*',  '[',  '~',
  372.         etc, these must be quoted, as in:
  373.  
  374.             kermit -g x\*.\?
  375.  
  376.         or:
  377.  
  378.             kermit -g "profile exec"
  379.  
  380. -f      Send a 'finish' command to a remote server.
  381.  
  382. -c      Establish  a  terminal  connection  over  the specified or default com-
  383.         munication line, before any protocol transaction takes place.  Get back
  384.         to   the   local  system  by  typing  the  escape  character  (normally
  385.         Control-Backslash) followed by the letter 'c'.
  386.  
  387. -n      Like -c, but after a protocol transaction takes place; -c  and  -n  may
  388.         both  be used in the same command.  The use of -n and -c is illustrated
  389.         below.
  390.  
  391. If the other Kermit is on a remote system, the -l and -b options should also be
  392. included with the -r, -k, or -s options.
  393.  
  394. Several other command-line options are provided:
  395.  
  396. -i      Specifies that files should be sent or received exactly "as is" with no
  397.         conversions.  This option is necessary for transmitting  binary  files.
  398.         It may also be used in Unix-to-Unix transfers (it must be given to both
  399.         Unix Kermit programs), where it will improve performance by circumvent-
  400.         ing  the  normal  text-file conversions, and will allow mixture of text
  401.         and binary files in a single file group.
  402.  
  403. -w      Write-Protect -- Avoid filename collisions for incoming files.
  404.  
  405. -e n    Extended packet length -- Specify that C-Kermit is allowed  to  receive
  406.         packets  up  to length n, where n may be between 10 and some large num-
  407.         ber, like 1000 or 2000, depending on the system.  The  default  maximum
  408.         length for received packets is 90.  Packets longer than 94 will be used
  409.         only if the other Kermit supports, and agrees to use, the "long packet"
  410.         protocol extension.
  411.  
  412. -q      Quiet  --  Suppress screen update during file transfer, for instance to
  413.         allow a file transfer to proceed in the background.
  414.  
  415. -d      Debug -- Record debugging information in the file debug.log in the cur-
  416.         rent  directory.    Use  this option if you believe the program is mis-
  417.         behaving, and show the resulting log to your local Kermit maintainer.
  418.  
  419. -h      Help -- Display a brief synopsis of the command line options.
  420.  
  421. The command line may contain no more than one protocol action option.
  422.  
  423. Files are sent with their own names, except that lowercase letters  are  raised
  424. to upper, pathnames are stripped off, certain special characters like (`~') and
  425. (`#') are changed to `X', and if the file name begins with a period, an `X'  is
  426. inserted  before  it.    Incoming files are stored under their own names except
  427. that uppercase letters are lowered, and, if -w  was  specified,  a  "generation
  428. number"  is  appended  to  the name if it has the same name as an existing file
  429. which would otherwise be overwritten.  If the -a option is included,  then  the
  430. same  rules  apply to its argument.  The file transfer display shows any trans-
  431. formations performed upon filenames.
  432.  
  433. During transmission, files are encoded as follows:
  434.  
  435.    - Control characters are converted to prefixed printables.
  436.  
  437.    - Sequences of repeated characters are collapsed via repeat counts,  if
  438.      the other Kermit is also capable of repeated-character compression.
  439.  
  440.    - If  parity  is  being used on the communication line, data characters
  441.      with the 8th (parity) bit on are  specially  prefixed,  provided  the
  442.      other  Kermit  is  capable of 8th-bit prefixing; if not, 8-bit binary
  443.      files cannot be successfully transferred.
  444.  
  445.    - Conversion is done between Unix newlines and carriage-return-linefeed
  446.      sequences unless the -i option was specified.
  447.  
  448.  
  449. Command Line Examples:
  450.  
  451.  
  452.     kermit -l /dev/ttyi5 -b 1200 -cn -r
  453.  
  454. This command connects you to the system on the other end of ttyi5 at 1200 baud,
  455. where you presumably log in and run Kermit with a 'send' command.    After  you
  456. escape  back,  C-Kermit  waits  for a file (or files) to arrive.  When the file
  457. transfer is completed, you are reconnected to the remote system so that you can
  458. logout.
  459.  
  460.  
  461.     kermit -l /dev/ttyi4 -b 1800 -cntp m -r -a foo
  462.  
  463. This  command  is like the preceding one, except the remote system in this case
  464. uses half duplex communication with mark parity.  The first file  that  arrives
  465. is stored under the name foo.
  466.  
  467.  
  468.     kermit -l /dev/ttyi6 -b 9600 -c | tek
  469.  
  470. This  example  uses  Kermit to connect your terminal to the system at the other
  471. end of ttyi6.  The C-Kermit terminal connection does not provide any particular
  472. terminal   emulation,   so   C-Kermit's   standard   i/o  is  piped  through  a
  473. (hypothetical) program called tek, which performs (say) Tektronix emulation.
  474.  
  475.  
  476.     kermit -l /dev/ttyi6 -b 9600 -nf
  477.  
  478. This command would be used to shut down a remote server and then connect to the
  479. remote system, in order to log out or to make further use of it.  The -n option
  480. is invoked after -f (-c would have been invoked before).
  481.  
  482.  
  483.     kermit -l /dev/ttyi6 -b 9600 -qg foo.\* &
  484.  
  485. This command causes C-Kermit to be invoked in the background, getting  a  group
  486. of files from a remote server (note the quoting of the `*' character).  No dis-
  487. play occurs on the screen, and the keyboard is  not  sampled  for  interruption
  488. commands.    This  allows other work to be done while file transfers proceed in
  489. the background.
  490.  
  491.  
  492.     kermit -l /dev/ttyi6 -b 9600 -g foo.\* > foo.log < /dev/null &
  493.  
  494. This command is like the previous one, except the  file  transfer  display  has
  495. been  redirected  to  the  file foo.log.  Standard input is also redirected, to
  496. prevent C-Kermit from sampling it for interruption commands.
  497.  
  498.  
  499.     kermit -iwx
  500.  
  501. This command starts up C-Kermit as a server.  Files  are  transmitted  with  no
  502. newline/carriage-return-linefeed conversion; the -i option is necessary for bi-
  503. nary file transfer and recommended for Unix-to-Unix transfers.  Incoming  files
  504. that have the same names as existing files are given new, unique names.
  505.  
  506.  
  507.     kermit -l /dev/ttyi6 -b 9600
  508.  
  509. This  command  sets  the  communication  line  and  speed.   Since no action is
  510. specified, C-Kermit issues a prompt and enters an interactive dialog with  you.
  511. Any  settings  given on the command line remain in force during the dialog, un-
  512. less explicitly changed.
  513.  
  514.  
  515.     kermit
  516.  
  517. This command starts up Kermit interactively with all default settings.
  518.  
  519. The next example shows how Unix Kermit might be used to send an  entire  direc-
  520. tory  tree  from  one Unix system to another, using the tar program as Kermit's
  521. standard input and output.  On the orginating system, in this case the  remote,
  522. type (for instance):
  523.  
  524.  
  525.     tar cf - /usr/fdc | kermit -is -
  526.  
  527. This  causes  tar to send the directory /usr/fdc (and all its files and all its
  528. subdirectories and all their files...) to standard output instead of to a tape;
  529. kermit  receives  this as standard input and sends it as a binary file.  On the
  530. receiving system, in this case the local one, type (for instance):
  531.  
  532.  
  533.     kermit -il /dev/ttyi5 -b 9600 -k | tar xf -
  534.  
  535. Kermit receives the tar archive, and sends it via standard output  to  its  own
  536. copy of tar, which extracts from it a replica of the original directory tree.
  537.  
  538. A  final example shows how a Unix compression utility might be used to speed up
  539. Kermit file transfers:
  540.  
  541.     compress file | kermit -is -     (sender)
  542.     kermit -ik | uncompress          (receiver)
  543.  
  544.  
  545. Exit Status Codes:
  546.  
  547. Unix Kermit returns an exit status of zero, except when a fatal  error  is  en-
  548. countered,  where  the  exit  status  is set to one.  With background operation
  549. (e.g., `&' at end of invoking command line) driven by scripted interactive com-
  550. mands  (redirected  standard  input  and/or take files), any failed interactive
  551. command (such as failed dial or script attempt) causes the fatal error exit.
  552.  
  553.  
  554. 1.4. Interactive Operation
  555.  
  556. C-Kermit's interactive command prompt is "C-Kermit>".    In  response  to  this
  557. prompt, you may type any valid interactive C-Kermit command.  C-Kermit executes
  558. the command and then prompts you for another command.   The  process  continues
  559. until you instruct the program to terminate.
  560.  
  561. Commands  begin  with a keyword, normally an English verb, such as "send".  You
  562. may omit trailing characters from any keyword, so  long  as  you  specify  suf-
  563. ficient  characters  to  distinguish  it  from  any other keyword valid in that
  564. field.  Certain commonly-used keywords (such as "send",  "receive",  "connect")
  565. also  have special non-unique abbreviations ("s" for "send", "r" for "receive",
  566. "c" for "connect").
  567.  
  568. Certain characters have special functions during  typein  of  interactive  com-
  569. mands:
  570.  
  571.     ?   Question  mark, typed at any point in a command, will produce a message
  572.         explaining what is possible or expected at that point.    Depending  on
  573.         the  context, the message may be a brief phrase, a menu of keywords, or
  574.         a list of files.
  575.  
  576.     ESC (The Escape or Altmode  key)  --  Request  completion  of  the  current
  577.         keyword  or filename, or insertion of a default value.  The result will
  578.         be a beep if the requested operation fails.
  579.  
  580.     TAB (The horizontal Tab key) -- Same as ESC.
  581.  
  582.     DEL (The Delete or Rubout key) -- Delete the previous  character  from  the
  583.         command.  You may also use BS (Backspace, Control-H) for this function.
  584.  
  585.     ^W  (Control-W) -- Erase the rightmost word from the command line.
  586.  
  587.     ^U  (Control-U) -- Erase the entire command.
  588.  
  589.     ^R  (Control-R) -- Redisplay the current command.
  590.  
  591.     SP  (Space) -- Delimits fields (keywords, filenames, numbers) within a com-
  592.         mand.
  593.  
  594.     CR  (Carriage Return) -- Enters the command for execution.   LF  (Linefeed)
  595.         or FF (formfeed) may also be used for this purpose.
  596.  
  597.     \   (Backslash)  --  Enter  any  of  the above characters into the command,
  598.         literally.  To enter a backslash, type two backslashes in a  row  (\\).
  599.         A  backslash  at  the  end of a command line causes the next line to be
  600.         treated as a continuation line; this is useful for readability in  com-
  601.         mand files, especially in the 'script' command.
  602.  
  603.     ^Z  (Control-Z)  --  On  systems (like Berkeley Unix, Ultrix) with job con-
  604.         trol, suspend Kermit, i.e. put it into the  background in  such  a  way
  605.         that  it  can  be  brought  back into the foreground (e.g. with an 'fg'
  606.         shell command) with all its settings intact.
  607.  
  608. You may type the editing characters (DEL, ^W, etc) repeatedly,  to  delete  all
  609. the  way  back to the prompt.  No action will be performed until the command is
  610. entered by typing carriage return, linefeed, or formfeed.  If you make any mis-
  611. takes,  you  will receive an informative error message and a new prompt -- make
  612. liberal use of `?' and ESC to feel your way through the commands.   One  impor-
  613. tant command is "help" -- you should use it the first time you run C-Kermit.
  614.  
  615. A command line beginning with a percent sign "%" is ignored.  Such lines may be
  616. used to include illustrative commentary in Kermit command dialogs.
  617.  
  618. Interactive C-Kermit accepts commands from files as well as from the  keyboard.
  619. When you start C-Kermit, the program looks for the file .kermrc in your home or
  620. current directory (first it looks in the home directory, then  in  the  current
  621. one)  and  executes any commands it finds there.  These commands must be in in-
  622. teractive format, not Unix command-line format.    A  "take"  command  is  also
  623. provided  for  use  at  any  time  during  an  interactive  session,  to  allow
  624. interactive-format commands to be executed from a file; command  files  may  be
  625. nested to any reasonable depth.
  626.  
  627. Here is a brief list of C-Kermit interactive commands:
  628.               %  Comment
  629.               !  Execute a Unix shell command, or start a shell.
  630.             bye  Terminate and log out a remote Kermit server.
  631.           close  Close a log file.
  632.         connect  Establish a terminal connection to a remote system.
  633.             cwd  Change Working Directory (also, cd).
  634.            dial  Dial a telephone number.
  635.       directory  Display a directory listing.
  636.            echo  Display arguments literally.
  637.            exit  Exit from the program, closing any open files.
  638.          finish  Instruct a remote Kermit server to exit, but not log out.
  639.             get  Get files from a remote Kermit server.
  640.          hangup  Hang up the phone (for use in local mode).
  641.            help  Display a help message for a given command.
  642.             log  Open a log file -- debugging, packet, session, transaction.
  643.            quit  Same as 'exit'.
  644.         receive  Passively wait for files to arrive.
  645.          remote  Issue file management commands to a remote Kermit server.
  646.          script  Execute a login script with a remote system.
  647.            send  Send files.
  648.          server  Begin server operation.
  649.             set  Set various parameters.
  650.            show  Display values of 'set' parameters.
  651.           space  Display current disk space usage.
  652.      statistics  Display statistics about most recent transaction.
  653.            take  Execute commands from a file.
  654.        transmit  Upload a file with no error checking.
  655.  
  656. The 'set' parameters are:
  657.      attributes  Turn Attribute packet processing on or off.
  658.     block-check  Level of packet error detection.
  659.           delay  How long to wait before sending first packet.
  660.          duplex  Specify which side echoes during 'connect'.
  661.     escape-character  Prefix for "escape commands" during 'connect'.
  662.            file  Set various file parameters.
  663.    flow-control  Communication line full-duplex flow control.
  664.       handshake  Communication line half-duplex turnaround character.
  665.      incomplete  Disposition for incompletely received files.
  666.            line  Communication line device name.
  667.    modem-dialer  Type of modem-dialer on communication line.
  668.          parity  Communication line character parity.
  669.          prompt  The C-Kermit program's interactive command prompt.
  670.         receive  Parameters for inbound packets.
  671.           retry  Packet retransmission limit.
  672.          server  Parameters for server operation.
  673.            send  Parameters for outbound packets.
  674.           speed  Communication line speed.
  675.        terminal  Terminal parameters.
  676.  
  677. The 'remote' commands are:
  678.             cwd  (or cd) Change remote working directory.
  679.          delete  Delete remote files.
  680.       directory  Display a listing of remote file names.
  681.            help  Request help from a remote server.
  682.            host  A command to the remote host in its own command language.
  683.           space  Display current disk space usage on remote system.
  684.            type  Display a remote file on your screen.
  685.             who  Display who's logged in, or get information about a user.
  686.  
  687. Most of these commands are described adequately in the Kermit User Guide or the
  688. Kermit book.  Special aspects of certain Unix  Kermit  commands  are  described
  689. below.
  690.  
  691.  
  692.                               THE 'SEND' COMMAND
  693.  
  694. Syntax:  send fn  - or -  send fn1 rfn1
  695.  
  696. Send  the file or files denoted by fn to the other Kermit, which should be run-
  697. ning as a server, or which should be given the 'receive' command.   The  'send'
  698. command may be abbreviated to 's', even though 's' is not a unique abbreviation
  699. for a top-level C-Kermit command.  Each file is sent under  its  own  name  (as
  700. described  above,  or  as  specified  by the 'set file names' command).  If the
  701. second form of the 'send' command is used, i.e.  with  fn1  denoting  a  single
  702. Unix file, rfn1 may be specified as a name to send it under.  For example:
  703.  
  704.     send sows.ear silk.purse
  705.  
  706. sends the file sows.ear but tells the other Kermit that its name is silk.purse.
  707.  
  708. The wildcard (meta) characters `~', `*', and `?' are accepted in fn.  If `?' is
  709. to be included, it must be prefixed by `\' to override its normal  function  of
  710. providing  help.    `~'  is treated as a meta character only if it is the first
  711. character in the file specification.  If it is followed immediately by a slash,
  712. a  space, or end of line, then your login directory name is substituted.  If it
  713. is followed immediately by a username, then that user's login directory name is
  714. substituted.   The `*' character matches any string, and `?' matches any single
  715. character.  Other notations for file groups, like `[a-z]og', are not  available
  716. in  interactive  commands  (though  of course they are available on the command
  717. line).  When fn contains `*' or `?' characters, there is a limit to the  number
  718. of  files  that can be matched, which varies from system to system.  If you get
  719. the message "Too many files match" then you'll have to make  a  more  judicious
  720. selection.  If fn was of the form:
  721.  
  722.     usr/longname/anotherlongname/*
  723.  
  724. then  C-Kermit's  string space will fill up rapidly -- try using 'cd' to change
  725. your directory to the path in question and reissuing the command.
  726.  
  727. When C-Kermit sends each file, it also sends certain information about the file
  728. in  an "attribute packet", provided the other Kermit agrees to accept attribute
  729. packets.  This information includes the size, type (text or binary,  determined
  730. from  the  "-i"  command-line  option or the "set file type" command), creation
  731. date, and a code to let the other Kermit know that the file is being sent  from
  732. a Unix system.  The other Kermit may accept or refuse the file based upon these
  733. attributes, for example, if it doesn't have enough disk space to store  a  file
  734. of the specified size.
  735.  
  736. The  file  type  attribute  allows  C-Kermit,  when sending a file, to tell the
  737. receiving whether it should be in text or  binary  mode.    Therefore,  if  the
  738. receiving  Kermit  has  this feature, it is not necessay to give it a "set file
  739. type" command to "match modes" with C-Kermit.
  740.  
  741. Note -- C-Kermit sends only from the current or specified directory.   It  does
  742. not traverse directory trees.  If the source directory contains subdirectories,
  743. they will be skipped.  By the same token, C-Kermit does not create  directories
  744. when  receiving files.  If you have a need to do this, you can pipe tar through
  745. C-Kermit, as shown in the example on page 3, or under System III/V Unix you can
  746. use cpio.
  747.  
  748. Another  Note  --  The 'send' command does not skip over "invisible" files that
  749. match the file specification; Unix systems  usually  treat  files  whose  names
  750. start  with  a  dot (like .login, .cshrc, and .kermrc) as invisible.  Similarly
  751. for "temporary" files whose names start with "#".
  752.  
  753.  
  754.                              THE 'RECEIVE' COMMAND
  755.  
  756. Syntax:  receive  - or -  receive fn1
  757.  
  758. Passively wait for files to arrive from the other Kermit, which must  be  given
  759. the 'send' command -- the 'receive' command does not work in conjunction with a
  760. server (use 'get' for that).  If fn1 is specified,  store  the  first  incoming
  761. file under that name.  The 'receive' command may be abbreviated to 'r'.
  762.  
  763. Incoming file data is normally decoded and stored according to whether C-Kermit
  764. is in text or binary mode.  But if the other Kermit  sends  the  file-type  at-
  765. tribute,  this  will override C-Kermit's file-type setting on a per-file basis.
  766. Therefore, it is possible for another Kermit program to send C-Kermit a mixture
  767. of  text and binary files, so long as the type of each file is indicated in the
  768. Attribute packet.
  769.  
  770.  
  771.                               THE 'GET' COMMAND:
  772.  
  773. Syntax:  get rfn
  774.  
  775.         or: get
  776.                 rfn
  777.                 fn1
  778.  
  779. Request a remote Kermit server to send the named file or files.  Since a remote
  780. file  specification  (or  list)  might  contain  spaces, which normally delimit
  781. fields of a C-Kermit command, an alternate form of the command is  provided  to
  782. allow  the inbound file to be given a new name: type 'get' alone on a line, and
  783. you will be prompted separately for the remote and local  file  specifications,
  784. for example:
  785.  
  786.     C-Kermit>get
  787.      Remote file specification: profile exec
  788.      Local name to store it under: profile.exec
  789.  
  790. If a `?' is to be included in the remote file specification, you must prefix it
  791. with `\' to suppress its normal function of providing help.
  792.  
  793. If you have started a multiline 'get' command, you may escape from  its  lower-
  794. level prompts by typing a carriage return in response to the prompt, e.g.
  795.  
  796.     C-Kermit>get
  797.      Remote file specification: foo
  798.      Local name to store it under: (Type a carriage return here)
  799.     (cancelled)
  800.     C-Kermit>
  801.  
  802. After the 'get' command has been entered, the file transfer proceeds exactly as
  803. if you had given a 'send' command to the other Kermit and a  'receive'  command
  804. to this one.
  805.  
  806.  
  807.                              THE 'SERVER' COMMAND:
  808.  
  809. The 'server' command places C-Kermit in "server mode" on the currently selected
  810. communication line.  All further commands must arrive as valid  Kermit  packets
  811. from  the  Kermit  on  the  other  end of the line.  The Unix Kermit server can
  812. respond to the following commands:
  813.  
  814. Client Command         Server Response
  815.   get                    Sends files
  816.   send                   Receives files
  817.   mail                   Sends incoming files as e-mail to specified address
  818.   bye                    Attempts to log itself out
  819.   finish                 Exits to level from which it was invoked
  820.   remote directory       Sends directory lising
  821.   remote delete          Removes files
  822.   remote cwd             Changes working directory (also, remote cd)
  823.   remote type            Sends files to your screen
  824.   remote print           Receives a file and prints it
  825.   remote space           Reports about its disk usage
  826.   remote who             Shows who's logged in
  827.   remote host            Executes a Unix shell command
  828.   remote help            Lists these capabilities
  829.  
  830. The Unix Kermit server cannot always respond properly to a  BYE  command.    It
  831. will  attempt to do so using "kill()", but this will not work on all systems or
  832. under all conditions because of the complicated process structures that can  be
  833. set up under Unix.
  834.  
  835. If  the  Kermit  server  is  directed at an external line (i.e. it is in "local
  836. mode") then the console may be used for other work if you have 'set  file  dis-
  837. play  off'; normally the program expects the console to be used to observe file
  838. transfers and enter status queries or interruption commands.  The  way  to  get
  839. C-Kermit  into  background operation from interactive command level varies from
  840. system to system (e.g. on Berkeley Unix you would halt the program with ^Z  and
  841. then  use the C-Shell 'bg' command to continue it in the background).  The more
  842. common method is to invoke the program with the desired command line arguments,
  843. including "-q", and with a terminating "&".
  844.  
  845. When  the  Unix  Kermit server is given a 'remote host' command, it executes it
  846. using the shell invoked upon login, e.g. the Bourne shell, the K-Shell, or  the
  847. Berkeley C-Shell.
  848.  
  849.  
  850.                   THE 'REMOTE', 'BYE', AND 'FINISH' COMMANDS:
  851.  
  852. C-Kermit  may itself request services from a remote Kermit server.  In addition
  853. to 'send' and 'get', the following commands may also be sent from C-Kermit to a
  854. Kermit server:
  855.  
  856.     remote cwd [directory]
  857.         If the optional remote directory specification is included, you will be
  858.         prompted  on a separate line for a password, which will not echo as you
  859.         type it.  If the remote system does not require  a  password  for  this
  860.         operation,  just  type a carriage return.  'remote cd' is a synomym for
  861.         this command.
  862.  
  863.     remote delete rfn       delete remote file or files.
  864.     remote directory [rfn]  directory listing of remote files.
  865.     remote host command     command in remote host's own command language.
  866.     remote space            disk usage report from remote host.
  867.     remote type [rfn]       display remote file or files on the screen.
  868.     remote who [user]       display information about who's logged in.
  869.     remote help             display remote server's capabilities.
  870.  
  871.     bye and finish:
  872.         When  connected  to  a  remote  Kermit server, these commands cause the
  873.         remote server to terminate; 'finish' returns it  to  Kermit  or  system
  874.         command  level  (depending on the implementation or how the program was
  875.         invoked); 'bye' also requests it to log itself out.
  876.  
  877.  
  878.                         THE 'LOG' AND 'CLOSE' COMMANDS:
  879.  
  880. Syntax: log {debugging, packets, session, transactions} [ fn1 ]
  881.  
  882. C-Kermit's progress may be logged in various ways.  The 'log' command  opens  a
  883. log,  the  'close' command closes it.  In addition, all open logs are closed by
  884. the 'exit' and 'quit' commands.  A name may be specified for a log file; if the
  885. name is omitted, the file is created with a default name as shown below.
  886.  
  887. log debugging
  888.     This produces a voluminous log of the internal workings of C-Kermit, of use
  889.     to  Kermit developers or maintainers in tracking down suspected bugs in the
  890.     C-Kermit program.  Use of this feature dramatically slows down  the  Kermit
  891.     protocol.  Default name: debug.log.
  892.  
  893. log packets
  894.     This produces a record of all the packets that go in and out  of  the  com-
  895.     munication port.  This log is of use to Kermit maintainers who are tracking
  896.     down protocol problems in either C-Kermit or any Kermit  that  C-Kermit  is
  897.     connected to.  Default name:  packet.log.
  898.  
  899. log session
  900.     This log will contain a copy of everything you see on  your  screen  during
  901.     the  'connect' command, except for local messages or interaction with local
  902.     escape commands.  Default name:  session.log.
  903.  
  904. log transactions
  905.     The transaction log is a record of all the files that were sent or received
  906.     while transaction logging was in effect.    It  includes  time  stamps  and
  907.     statistics,  filename  transformations,  and records of any errors that may
  908.     have occurred.  The transaction log allows you to have long unattended file
  909.     transfer  sessions  without  fear  of  missing  some  vital screen message.
  910.     Default name:  transact.log.
  911.  
  912. The 'close' command explicitly closes a log, e.g. 'close debug'.
  913.  
  914. Note:  Debug and Transaction logs are a compile-time option;  C-Kermit  may  be
  915. compiled  without these logs, in which case it will run faster, it will take up
  916. less space on the disk, but the commands relating to them will not be present.
  917.  
  918.  
  919.                         LOCAL FILE MANAGEMENT COMMANDS:
  920.  
  921. Unix Kermit allows some degree of local file management from  interactive  com-
  922. mand level:
  923.  
  924. directory [fn]
  925.     Displays a listing of the names, modes, sizes, and dates of files  matching
  926.     fn (which defaults to `*').  Equivalent to `ls -l'.
  927.  
  928. cwd [directory-name]
  929.     Changes Kermit's working directory to the one  given,  or  to  the  default
  930.     directory  if the directory name is omitted.  This command affects only the
  931.     Kermit process and any processes it may subsequently create.  You may  also
  932.     type "cd" instead of "cwd".
  933.  
  934. space
  935.     Display information about disk space and/or quota in the current  directory
  936.     and device.
  937.  
  938. ! [command]
  939.     The command is executed by the Unix shell.  If  no  command  is  specified,
  940.     then  an  interactive  shell  is  started;  exiting from the shell, e.g. by
  941.     typing Control-D or 'exit', will return you to C-Kermit command level.  Use
  942.     the  `!'  command  to  provide  file  management or other functions not ex-
  943.     plicitly provided by C-Kermit  commands.    The  `!'  command  has  certain
  944.     peculiarities:
  945.  
  946.        - C-Kermit attempts to use your preferred, customary (login) shell.
  947.        - At least one space must separate the '!' from the shell command.
  948.        - A  'cd'  (change  directory) command executed in this manner will
  949.          have no effect -- use the C-Kermit 'cwd' command instead.
  950.  
  951.  
  952.                         THE 'SET' AND 'SHOW' COMMANDS:
  953.  
  954. Since Kermit is designed to allow diverse systems to communicate, it  is  often
  955. necessary  to  issue  special  instructions  to  allow  the program to adapt to
  956. peculiarities of another system or the communication path.  These  instructions
  957. are  accomplished by the 'set' command.  The 'show' command may be used to dis-
  958. play current settings.  Here is a brief synopsis of settings available  in  the
  959. current release of C-Kermit:
  960.  
  961. attributes {on, off}
  962.     Tells C-Kermit whether to exchange file attribute (A) packets.  Normally it
  963.     will do this if the other Kermit supports this option.  However, to prevent
  964.     any misunderstandings that may arise (e.g. the other Kermit is  refusing  a
  965.     file  because  it thinks there's not enough disk space, but there really is
  966.     enough disk space), you may 'set attributes off' to inhibit this  behavior.
  967.     C-Kermit  currently  sends  system  ID, file type, file size, file creation
  968.     date, and encoding attributes.  It honors acceptance and refusal of files.
  969.  
  970. block-check {1, 2, 3}
  971.     Determines  the  level  of  per-packet  error  detection.  "1" is a single-
  972.     character 6-bit checksum, folded to include the values  of  all  bits  from
  973.     each  character.    "2"  is  a  2-character,  12-bit  checksum.    "3" is a
  974.     3-character, 16-bit cyclic redundancy check (CRC).  The  higher  the  block
  975.     check,  the  better  the  error detection and correction and the higher the
  976.     resulting overhead.  Type 1 is most commonly used; it is supported  by  all
  977.     Kermit  implementations,  and it has proven adequate in most circumstances.
  978.     Types 2 or 3 should be used when transferring 8-bit binary files over noisy
  979.     lines, or when using long packets.
  980.  
  981. delay n
  982.     How many seconds to wait before sending the first  packet  after  a  'send'
  983.     command.  Used in remote mode to give you time to escape back to your local
  984.     Kermit and issue a 'receive' command before the  first  Kermit  packet  ap-
  985.     pears.  Normally 5 seconds.
  986.  
  987. duplex {full, half}
  988.     For use during 'connect'.  Specifies  which  side  is  doing  the  echoing;
  989.     'full'  means  the  other  side,  'half'  means  C-Kermit  must  echo  your
  990.     keystrokes itself.  Normally full.  Use half when  communicating  with  IBM
  991.     mainframes  over  linemode  connections, and on similar half-duplex connec-
  992.     tions.
  993.  
  994. escape-character cc
  995.     For use during 'connect' to get C-Kermit's attention.  The escape character
  996.     acts as a prefix to an 'escape command', for instance to close the  connec-
  997.     tion  and  return  to  C-Kermit  or  Unix command level.  The normal escape
  998.     character is Control-Backslash (ASCII 28).  The escape  character  is  also
  999.     used  in  System  III/V implementations to prefix interrupt commands during
  1000.     file transfers.
  1001.  
  1002. file {display, names, type, warning}
  1003.     Establish various file-related parameters:
  1004.  
  1005.     display {on, off}
  1006.         Normally 'on'; when in local mode, display progress of  file  transfers
  1007.         on  the  screen (stdout), and listen to the keyboard (stdin) for inter-
  1008.         ruptions.  If off (-q on command line) none of this is  done,  and  the
  1009.         file transfer may proceed in the background oblivious to any other work
  1010.         concurrently done at the console terminal.
  1011.  
  1012.     names {converted, literal}
  1013.         Normally  converted,  which  means  that  outbound  filenames have path
  1014.         specifications stripped, lowercase letters raised to upper, tildes  and
  1015.         extra  periods  changed  to X's, and an X inserted in front of any name
  1016.         that starts  with  period.    Incoming  files  have  uppercase  letters
  1017.         lowered.  Literal means that none of these conversions are done; there-
  1018.         fore, any directory path appearing in  a  received  file  specification
  1019.         must exist and be write-accessible.  When literal naming is being used,
  1020.         the sender should not use path names in the file  specification  unless
  1021.         the same path exists on the target system and is writable.
  1022.  
  1023.     type {binary, text} [{7, 8}]
  1024.         The file type is normally text, which means that conversion is done be-
  1025.         tween  Unix  newline  characters  and  the carriage-return/linefeed se-
  1026.         quences required by the canonical Kermit file transmission format,  and
  1027.         in  common use on non-Unix systems.  Binary means to transmit file con-
  1028.         tents without conversion.  Binary (`-i' in command  line  notation)  is
  1029.         necessary  for  binary  files, and desirable in all Unix-to-Unix trans-
  1030.         actions to cut down on overhead.
  1031.  
  1032.         The optional trailing parameter tells the bytesize for  file  transfer.
  1033.         It  is  8  by  default.    If you specify 7, the high order bit will be
  1034.         stripped from each byte of sent and received files.  This is useful for
  1035.         transferring text files that may have extraneous high order bits set in
  1036.         their disk representation (e.g.  Wordstar  or  similar  word  processor
  1037.         files).
  1038.  
  1039.     warning {on, off}
  1040.         Normally off, which means that incoming files will  silently  overwrite
  1041.         existing files of the same name.  When on (`-w' on command line) Kermit
  1042.         will check if an arriving file would overwrite an existing file; if so,
  1043.         it  will construct a new name for the arriving file, of the form foo~n,
  1044.         where foo is the name they share and n is a "generation number"; if foo
  1045.         exists,  then  the new file will be called foo~1.  If foo and foo~1 ex-
  1046.         ist, the new file will be foo~2, and so on.  If the new name  would  be
  1047.         longer than the maximum length for a filename, then characters would be
  1048.         deleted from the end first, for instance, thelongestname  on  a  system
  1049.         with a limit of 14 characters would become thelongestn~1.
  1050.  
  1051.             CAUTION:  If Control-F or Control-B is used to cancel an incom-
  1052.             ing file, and a file of the same name previously  existed,  and
  1053.             the  "file  warning"  feature is not enabled, then the previous
  1054.             copy of the file will disappear.
  1055.  
  1056. flow-control {none, xon/xoff}
  1057.     Normally xon/xoff for full duplex flow control.  Should be set to 'none' if
  1058.     the other system cannot do xon/xoff flow control, or if you have  issued  a
  1059.     'set  handshake' command.  If set to xon/xoff, then handshake should be set
  1060.     to none.  This setting applies during both  terminal  connection  and  file
  1061.     transfer.    Warning:  This command may have no effect on certain Unix sys-
  1062.     tems, where Kermit puts the communication line into 'rawmode', and  rawmode
  1063.     precludes flow control.
  1064.  
  1065. incomplete {discard, keep}
  1066.     Disposition for incompletely received files.  If an incoming file is inter-
  1067.     rupted  or  an  error occurs during transfer, the part that was received so
  1068.     far is normally discarded.  If you "set incomplete  keep"  then  such  file
  1069.     fragments will be kept.
  1070.  
  1071. handshake {xon, xoff, cr, lf, bell, esc, none}
  1072.     Normally none.  Otherwise, half-duplex communication line turnaround  hand-
  1073.     shaking  is  done, which means Unix Kermit will not reply to a packet until
  1074.     it has received the indicated handshake character or has timed out  waiting
  1075.     for  it;  the  handshake setting applies only during file transfer.  If you
  1076.     set handshake to other than none, then flow should be set to none.
  1077.  
  1078. line [device-name]
  1079.     The device name for the communication line to be used for file transfer and
  1080.     terminal connection, e.g. /dev/ttyi3.  If you specify a device name, Kermit
  1081.     will be in local mode, and you should remember to issue any other necessary
  1082.     'set' commands, such as 'set speed'.  If you omit the device  name,  Kermit
  1083.     will  revert  to  its  default mode of operation.  If you specify /dev/tty,
  1084.     Kermit will enter remote mode (useful when  logged  in  through  the  "back
  1085.     port"  of  a  system normally used as a local-mode workstation).  When Unix
  1086.     Kermit enters local mode, it attempts to synchronize  with  other  programs
  1087.     (like  uucp)  that  use  external  communication lines so as to prevent two
  1088.     programs using the same  line  at  once;  before  attempting  to  lock  the
  1089.     specified  line,  it  will  close  and  unlock  any  external line that was
  1090.     previously in use.  The method used for locking is the  "uucp  lock  file",
  1091.     explained in more detail later.
  1092.  
  1093. modem-dialer {direct, hayes, racalvadic, ventel, ...}
  1094.     The type of modem  dialer on the communication line.    "Direct"  indicates
  1095.     either  there  is  no  dialout  modem, or that if the line requires carrier
  1096.     detection to open, then 'set line' will hang waiting for an incoming  call.
  1097.     "Hayes",  "Ventel",  and  the  others  indicate  that 'set line' (or the -l
  1098.     argument) will prepare for  a  subsequent  'dial'  command  for  the  given
  1099.     dialer.    Support for new dialers is added from time to time, so type 'set
  1100.     modem ?' for a list of those supported in your copy of Kermit.    Also  see
  1101.     the  description of the 'dial' command.  NOTE: the "set modem" command must
  1102.     be given before the "set line" command.
  1103.  
  1104. parity {even, odd, mark, space, none}
  1105.     Specify  character  parity for use in packets and terminal connection, nor-
  1106.     mally none.  If other than none, C-Kermit will  seek  to  use  the  8th-bit
  1107.     prefixing  mechanism  for transferring 8-bit binary data, which can be used
  1108.     successfully only if the other Kermit agrees; if  not,  8-bit  binary  data
  1109.     cannot be successfully transferred.
  1110.  
  1111. prompt [string]
  1112.     The given string will be substituted  for  "C-Kermit>"  as  this  program's
  1113.     prompt.    If the string is omitted, the prompt will revert to "C-Kermit>".
  1114.     If the string is enclosed in doublequotes, the quotes will be stripped  and
  1115.     any leading and trailing blanks will be retained.
  1116.  
  1117. send parameter
  1118.     Establish parameters to use when sending packets.  These will be in  effect
  1119.     only for the initial packet sent, since the other Kermit may override these
  1120.     parameters during the protocol parameter exchange (unless noted below).
  1121.  
  1122.     end-of-packet cc
  1123.         Specifies the control character needed by the other Kermit to recognize
  1124.         the end of a packet.  C-Kermit sends this character at the end of  each
  1125.         packet.    Normally  13  (carriage return), which most Kermit implemen-
  1126.         tations require.  Other Kermits require no  terminator  at  all,  still
  1127.         others may require a different terminator, like linefeed (10).
  1128.  
  1129.     packet-length n
  1130.         Specify the maximum packet length to  send.    Normally  90.    Shorter
  1131.         packet  lengths  can be useful on noisy lines, or with systems or front
  1132.         ends or networks that have small buffers.  The shorter the packet,  the
  1133.         higher  the  overhead,  but the lower the chance of a packet being cor-
  1134.         rupted by noise, and the less time  to  retransmit  corrupted  packets.
  1135.         This  command  overrides the value requested by the other Kermit during
  1136.         protocol initiation unless the other Kermit requests a shorter length.
  1137.  
  1138.     pad-character cc
  1139.         Designate  a  character  to send before each packet.  Normally, none is
  1140.         sent.  Outbound padding is sometimes necessary for  communicating  with
  1141.         slow half duplex systems that provide no other means of line turnaround
  1142.         control.  It can also be used to send special characters to  communica-
  1143.         tions  equipment  that  needs  to  be put in "transparent" or "no echo"
  1144.         mode, when this can be accomplished in by feeding it a certain  control
  1145.         character.
  1146.  
  1147.     padding n
  1148.         How many pad characters to send, normally 0.
  1149.  
  1150.     start-of-packet cc
  1151.         The  normal Kermit packet prefix is Control-A (1); this command changes
  1152.         the prefix C-Kermit puts on outbound packets.  The  only  reasons  this
  1153.         should  ever be changed would be: Some piece of equipment somewhere be-
  1154.         tween the two Kermit programs will not pass through  a  Control-A;  or,
  1155.         some  piece  of of equipment similarly placed is echoing its input.  In
  1156.         the latter case, the recipient of such an echo can  change  the  packet
  1157.         prefix for outbound packets to be different from that of arriving pack-
  1158.         ets, so that the echoed packets will be ignored.  The  opposite  Kermit
  1159.         must also be told to change the prefix for its inbound packets.
  1160.  
  1161.     timeout n
  1162.         Specifies the number of seconds you want the other Kermit to wait for a
  1163.         packet before timing it out and requesting retransmission.
  1164.  
  1165. receive parameter
  1166.     Establish parameters to request the other Kermit to use when sending  pack-
  1167.     ets.
  1168.  
  1169.     end-of-packet cc
  1170.         Requests the other Kermit to terminate its packets with  the  specified
  1171.         character.
  1172.  
  1173.     packet-length n
  1174.         Specify the maximum packet length to that you want the other Kermit  to
  1175.         send,  normally  90.  If you specify a length of 95 or greater, then it
  1176.         will be used if the other Kermit supports, and agrees to use, the  Ker-
  1177.         mit  protocol  extension  for  long packets.  In this case, the maximum
  1178.         length depends upon the systems involved, but there would  normally  be
  1179.         no  reason for packets to be more than about 1000 characters in length.
  1180.         The 'show parameters' command displays C-Kermit's current  and  maximum
  1181.         packet lengths.
  1182.  
  1183.     pad-character cc
  1184.         C-Kermit normally does not need to have incoming packets preceded  with
  1185.         pad characters.  This command allows C-Kermit to request the other Ker-
  1186.         mit to use cc as a pad character.  Default cc is NUL, ASCII 0.
  1187.  
  1188.     padding n
  1189.         How many pad characters to ask for, normally 0.
  1190.  
  1191.     start-of-packet cc
  1192.         Change the prefix C-Kermit looks for on inbound packets  to  correspond
  1193.         with what the other Kermit is sending.
  1194.  
  1195.     timeout n
  1196.         Normally, each Kermit partner sets its packet timeout interval based on
  1197.         what the opposite Kermit requests.  This command allows you to override
  1198.         the normal procedure and specify a timeout interval for Unix Kermit  to
  1199.         use  when waiting for packets from the other Kermit.  If you specify 0,
  1200.         then no timeouts will occur, and Unix Kermit will wait forever for  ex-
  1201.         pected packets to arrive.
  1202.  
  1203. server timeout n
  1204.     Specify the time interval n in seconds for the C-Kermit server to send  NAK
  1205.     packets  while  waiting  for  a command packet.  These NAKs are intended to
  1206.     break deadlocks in case a client Kermit that cannot time out sends  a  com-
  1207.     mand  packet  which is lost.  However, the server command-wait NAKs can in-
  1208.     terfere with originate/answer devices that are to be  used  for  answering.
  1209.     For  example,  you  can run a C-Kermit server on a modem line that normally
  1210.     dials out, so that people can dial in  to  it  and  give  Kermit  commands.
  1211.     While  waiting  for the phone call to come, the server NAKs might "wake up"
  1212.     the modem and put it into originate mode, preventing the incoming call from
  1213.     being answered.
  1214.  
  1215. speed {0, 110, 150, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200}
  1216.     The transmission speed in bits per second ("baud rate")  for  the  external
  1217.     communication  line.    This  command cannot be used to change the speed of
  1218.     your own console terminal.  Many Unix systems are set up in such a way that
  1219.     you  must  give  this command after a 'set line' command before you can use
  1220.     the line.  'set baud' is a synomym for 'set speed'.  Use 19200 with caution
  1221.     -- it may not work on all systems.
  1222.  
  1223. terminal
  1224.     Used for specifying terminal parameters.  Currently, 'bytesize' is the only
  1225.     parameter  provided, and it can be set to 7 or 8.  It's 7 by default, which
  1226.     means that the high-order (8th) bit is stripped from each incoming and out-
  1227.     going character.
  1228.  
  1229.  
  1230.                               THE 'SHOW' COMMAND:
  1231.  
  1232. Syntax: show {parameters, versions}
  1233.  
  1234. The  "show"  command  with  the  default  argument of "parameters" displays the
  1235. values of all the  'set'  parameters  described  above.    If  you  type  "show
  1236. versions",  then C-Kermit will display the version numbers and dates of all its
  1237. internal modules.  You should use the "show versions" command to ascertain  the
  1238. vintage of your Kermit program before reporting problems to Kermit maintainers.
  1239.  
  1240.  
  1241.                            THE 'STATISTICS' COMMAND:
  1242.  
  1243. The  statistics  command  displays  information  about  the  most recent Kermit
  1244. protocol transaction, including file and communication line i/o, timing and ef-
  1245. ficiency,  as  well  as  what  encoding options were in effect (such as 8th-bit
  1246. prefixing, repeat-count compression).
  1247.  
  1248.  
  1249.                         THE 'TAKE' AND 'ECHO' COMMANDS:
  1250.  
  1251. Syntax: take fn1
  1252.      echo [text to be echoed]
  1253.  
  1254. The 'take' command instructs C-Kermit to execute commands from the named  file.
  1255. The  file may contain any interactive C-Kermit commands, including 'take'; com-
  1256. mand files may be nested to any reasonable depth, but it may not  contain  text
  1257. to  be sent to a remote system during the 'connect' command.  This means that a
  1258. command file like this:
  1259.  
  1260.     set line /dev/tty17
  1261.     set speed 9600
  1262.     connect
  1263.     login myuserid
  1264.     mypassword
  1265.     etc
  1266.  
  1267. will not send "login myserid" or any of the following text to the  remote  sys-
  1268. tem.  To carry on a canned dialog, use the 'script' command, described later.
  1269.  
  1270. The '%' command is useful for including comments in take-command files.  It may
  1271. only be used at the beginning of a line.
  1272.  
  1273. The 'echo' command may be used within command files  to  issue  greetings,  an-
  1274. nounce progress, ring the terminal bell, etc.  The 'echo' command should not be
  1275. confused with the Unix 'echo' command, which can  be  used  to  show  how  meta
  1276. characters would be expanded.  The Kermit echo command simply displays its text
  1277. argument (almost) literally at the terminal; the argument may contain octal es-
  1278. capes  of the form "\ooo", where o is an octal digit (0-7), and there may be 1,
  1279. 2, or 3 such digits, whose value specifies an ASCII character, such  as  "\007"
  1280. (or "\07" or just "\7") for beep, "\012" for newline, etc.  Each backslash must
  1281. be must be entered twice in order for it to be passed along to the echo command
  1282. by the Kermit command parser.
  1283.  
  1284. Take-command  files  are  in  exactly  the same syntax as interactive commands.
  1285. Note that this implies that if you want  to  include  special  characters  like
  1286. question  mark  or  backslash  that you would have to quote with backslash when
  1287. typing interactive commands, you must quote these characters the  same  way  in
  1288. command  files.  Long lines may be continued by ending them with a single back-
  1289. slash.
  1290.  
  1291. Command files may be used in lieu of command macros, which have  not  been  im-
  1292. plemented  in  this version of C-Kermit.  For instance, if you commonly connect
  1293. to a system called 'B' that is connected to  ttyh7  at  4800  baud,  you  could
  1294. create a file called b containing the commands
  1295.  
  1296.     % C-Kermit command file to connect to System B thru /dev/ttyh7
  1297.     set line /dev/ttyh7
  1298.     set speed 4800
  1299.     % Beep and give message
  1300.     echo \\007Connecting to System B...
  1301.     connect
  1302.  
  1303. and  then simply type 'take b' (or 't b' since no other commands begin with the
  1304. letter 't') whenever you wish to connect to system B. Note  the  comment  lines
  1305. and the beep inserted into the 'echo' command.
  1306.  
  1307. For  linemode connections to IBM mainframes, a number of 'set' commands are re-
  1308. quired; these, too, can be conveniently collected into a 'take' file like  this
  1309. one:
  1310.  
  1311.     % Sample C-Kermit command file to set up current line
  1312.     % for IBM mainframe communication
  1313.     %
  1314.     set parity mark
  1315.     set handshake xon
  1316.     set flow-control none
  1317.     set duplex half
  1318.  
  1319. Note  that no single command is available to wipe out all of these settings and
  1320. return C-Kermit to its default startup state; to do that, you can  either  res-
  1321. tart the program, or else make a command file that executes the necessary 'set'
  1322. commands:
  1323.  
  1324.     % Sample C-Kermit command file to restore normal settings
  1325.     %
  1326.     set parity none
  1327.     set handshake none
  1328.     set flow-control xon/xoff
  1329.     set duplex full
  1330.  
  1331. An implicit 'take' command is executed upon your  .kermrc  file  when  C-Kermit
  1332. starts  up,  upon  either  interactive or command-line invocation.  The .kermrc
  1333. file should contain 'set' or other commands you want to be  in  effect  at  all
  1334. times.   For instance, you might want override the default action when incoming
  1335. files have the same names as existing files -- in that case, put the command
  1336.  
  1337.     set file warning on
  1338.  
  1339. in your .kermrc file.  On some non-Unix systems  that  run  C-Kermit,  the  in-
  1340. itialization   file  might  have  a  different  name,  such  as  kermit.ini  or
  1341. ckermit.ini.
  1342.  
  1343. Errors encountered during execution of take files (such as failure to  complete
  1344. dial  or script operations) cause termination of the current take file, popping
  1345. to the level that invoked it (take file,  interactive  level,  or  the  shell).
  1346. When  kermit  is  executed in the background, errors during execution of a take
  1347. file are fatal.
  1348.  
  1349. Under Unix, you may  also  use  the  shell's  redirection  mechanism  to  cause
  1350. C-Kermit to execute commands from a file:
  1351.  
  1352.     kermit < cmdfile
  1353.  
  1354. or you can even pipe commands in from another process:
  1355.  
  1356.     command | kermit
  1357.  
  1358.  
  1359.                             THE 'CONNECT' COMMAND:
  1360.  
  1361. The  'connect'  command  ('c'  is  an  acceptable  non-unique  abbreviation for
  1362. 'connect') links your terminal to another computer as if it were a  local  ter-
  1363. minal  to  that  computer, through the device specified in the most recent 'set
  1364. line' command, or through the default device if your system is a PC or worksta-
  1365. tion.   All characters you type at your keyboard are sent out the communication
  1366. line (and if you have 'set duplex half', also displayed on  your  screen),  and
  1367. all  characters arriving at the communication port are displayed on the screen.
  1368. Current settings of speed, parity, duplex, and flow-control  are  honored,  and
  1369. the  data connection is 7 bits wide unless you have given the command 'set ter-
  1370. minal bytesize 8'.  If you have issued a 'log session' command, everything  you
  1371. see  on your screen will also be recorded to your session log.  This provides a
  1372. way to "capture" files from remote systems  that  don't  have  Kermit  programs
  1373. available.
  1374.  
  1375. To  get  back  to your own system, you must type the escape character, which is
  1376. Control-Backslash (^\) unless you have changed it with the  'set  escape'  com-
  1377. mand,   followed  by  a  single-character  command,  such  as  'c'  for  "close
  1378. connection".  Single-character commands include:
  1379.  
  1380.   c     Close the connection
  1381.   b     Send a BREAK signal
  1382.   0     (zero) send a null
  1383.   s     Give a status report about the connection
  1384.   h     Hangup the phone
  1385.   ^\    Send Control-Backslash itself (whatever you  have  defined  the  escape
  1386.         character to be, typed twice in a row sends one copy of it).
  1387.  
  1388. Uppercase  and  control  equivalents  for  (most of) these letters are also ac-
  1389. cepted.  A space typed after the  escape  character  is  ignored.    Any  other
  1390. character will produce a beep.
  1391.  
  1392. The  connect  command simply displays incoming characters on the screen.  It is
  1393. assumed any screen control sequences sent by the host will be  handled  by  the
  1394. firmware  or  emulation  software  in your terminal or PC.  If special terminal
  1395. emulation is desired, then the 'connect' command can invoked from the Unix com-
  1396. mand line (-c or -n), piped through a terminal emulation filter, e.g.
  1397.  
  1398.     kermit -l /dev/acu -b 1200 -c | tek
  1399.  
  1400.  
  1401.                              THE 'HANGUP' COMMAND:
  1402.  
  1403. The 'hangup' command attempts to hang up the modem on a local-mode dialout con-
  1404. nection.
  1405.  
  1406.  
  1407.                               THE 'DIAL' COMMAND:
  1408.  
  1409. Syntax: dial telephone-number-string
  1410.  
  1411. This command controls dialout modems; you should have  already  issued  a  "set
  1412. line"  and  "set  speed"  command  to  identify the terminal device, and a "set
  1413. modem" command to identify the type of modem to be used for dialing.    In  the
  1414. "dial"  command, you supply the phone number and the Kermit program feeds it to
  1415. the modem in the appropriate format and then interprets dialer return codes and
  1416. modem  signals  to  inform  you whether the call was completed.  The telephone-
  1417. number-string may contain imbedded modem-dialer commands,  such  as  comma  for
  1418. Hayes  pause, or `&' for Ventel dialtone wait and `%' for Ventel pause (consult
  1419. your modem manual for details).
  1420.  
  1421. At the time of this writing, support is included for the following modems:
  1422.  
  1423.    - AT&T 7300 Internal Modem
  1424.    - Cermetek Info-Mate 212A
  1425.    - Concord Condor CDS 220
  1426.    - DEC DF03-AC
  1427.    - DEC DF100 Series
  1428.    - DEC DF200 Series
  1429.    - General DataComm 212A/ED
  1430.    - Hayes Smartmodem and compatibles
  1431.    - Microcom AX-9624
  1432.    - Penril
  1433.    - Racal Vadic
  1434.    - Rolm CBX
  1435.    - US Robotics 212A
  1436.    - Ventel
  1437. Support for new modems is added to the program from time to time; you can check
  1438. the current list by typing "set modem ?".
  1439.  
  1440. There  are also two "generic" modem types -- "direct" (i.e. no modem at all, so
  1441. that no attempt is made to deal with modem signals), and "unknown" (which tells
  1442. C-Kermit  to  attempt  to honor modem signals, but leaves the dialing mechanism
  1443. unspecified).
  1444.  
  1445. The device used for dialing out is the one selected in  the  most  recent  "set
  1446. line"  command  (or on a workstation, the default line if no "set line" command
  1447. was given).  The "dial" command calls attempts to lock  the  terminal  device's
  1448. path  (see the section on line locking below) and to establish a call on an ex-
  1449. clusive basis.  If it is desired to dial a call and then return  to  the  shell
  1450. (such  as to do kermit activities depending on standard in/out redirection), it
  1451. is necessary to place the dialed call under one device name (say,  "/dev/cua0")
  1452. and then escape to the shell within Kermit on a linked device which is separate
  1453. from the dialed line (say, "/dev/cul0").  This is the same  technique  used  by
  1454. uucp (to allow locks to be placed separately for dialing and conversing).
  1455.  
  1456. Because  modem  dialers have strict requirements to override the carrier-detect
  1457. signal most Unix implementations expect, the sequence for dialing is more rigid
  1458. than most other C-Kermit procedures.
  1459.  
  1460. Example one:
  1461.  
  1462.     kermit -l /dev/cul0 -b 1200
  1463.     C-Kermit>set modem-dialer hayes    hint: abbreviate set m h
  1464.     C-Kermit>dial 9,5551212
  1465.     Connected!
  1466.     C-Kermit>connect                   hint: abbreviate c
  1467.     logon, request remote server, etc.
  1468.     ^\c                                escape back
  1469.     C-Kermit> ...
  1470.     C-Kermit>quit                      hint: abbreviate q
  1471.  
  1472. this disconnects modem, and unlocks line.
  1473.  
  1474. Example two:
  1475.  
  1476.     kermit
  1477.     C-Kermit>set modem-dialer ventel
  1478.     C-Kermit>set line /dev/cul0
  1479.     C-Kermit>dial 9&5551212%
  1480.     Connected!
  1481.     C-Kermit> ...
  1482.  
  1483. Example three:
  1484.  
  1485.     kermit
  1486.     C-Kermit>take my-dial-procedure
  1487.     Connected!
  1488.  
  1489.     file my-dial-procedure:
  1490.     set modem hayes
  1491.     set line /dev/tty99
  1492.     dial 5551212
  1493.     connect
  1494.  
  1495. In  general, C-Kermit requires that the modem provide the "carrier detect" (CD)
  1496. signal when a call is in progress, and remove that signal when  the  call  com-
  1497. pletes  or the line drops.  If a modem switch setting is available to force CD,
  1498. it should normally not be in that setting.  C-Kermit  also  requires  (on  most
  1499. systems)  that  the modem track the computer's "data terminal ready" (DTR) sig-
  1500. nal.  If a switch setting is available to  simulate  DTR  asserted  within  the
  1501. modem,  then  it  should  normally not be in that setting.  Otherwise the modem
  1502. will be unable to hang up at the end of a call or when interrupts are  received
  1503. by Kermit.
  1504.  
  1505. For  Hayes  1200  dialers, two important switch settings are #1 and #6.  Switch
  1506. #1 should be normally be UP so  that  the  modem  can  act  according  to  your
  1507. computer's  DTR  signal.  But if your computer, or particular implementation of
  1508. Kermit, cannot control DTR, then switch 1 should be DOWN.    Switch  #6  should
  1509. normally  be  UP  so  carrier-detect functions properly (but put it DOWN if you
  1510. have trouble with the UP position).  Switches #2 (English versus  digit  result
  1511. codes)  and  #4 (Hayes echoes modem commands) may be in either position.  Hayes
  1512. 2400 modems have equivalent "software" switches.
  1513.  
  1514. If you want to interrupt a dial command in progress (for instance, because  you
  1515. just  realize  that you gave it the wrong number), type a Control-C to get back
  1516. to command level.
  1517.  
  1518.  
  1519.                              THE 'SCRIPT' COMMAND:
  1520.  
  1521. Syntax: script expect send [expect send] . . .
  1522.  
  1523. "expect" has the syntax: expect[-send-expect[-send-expect[...]]]
  1524.  
  1525. The 'script' command carries on a "canned dialog"  with  a  remote  system,  in
  1526. which data is sent according to the remote system's responses.  The typical use
  1527. is for logging in to a remote system automatically.
  1528.  
  1529. C-Kermit's script facility operates in a manner similar to that  commonly  used
  1530. by  the  Unix UUCP system's "L.sys" file entries.  A login script is a sequence
  1531. of the form:
  1532.  
  1533.     expect send [expect send] . . .
  1534.  
  1535. where expect is a prompt or message to be issued by the remote site,  and  send
  1536. is  the  string (names, numbers, etc) to return, and expects are separated from
  1537. sends by spaces.  The send may also be the keyword EOT, to send  Control-D,  or
  1538. BREAK, to send a break signal.  Letters in sends may be prefixed by `~' to send
  1539. special characters, including:
  1540.  
  1541.     ~b  backspace
  1542.     ~s  space
  1543.     ~q  `?'(trapped by Kermit's command interpreter)
  1544.     ~n  linefeed
  1545.     ~r  carriage return
  1546.     ~t  tab
  1547.     ~'  single quote
  1548.     ~~  tilde
  1549.     ~"  double quote
  1550.     ~x  XON (Control-Q)
  1551.     ~c  don't append a carriage return
  1552.     ~o[o[o]]  an octal character
  1553.     ~d  delay approx 1/3 second during send
  1554.     ~w[d[d]]  wait specified interval during expect, then time out
  1555.  
  1556. As with some UUCP systems, sent strings are followed by ~r unless they  have  a
  1557. ~c.
  1558.  
  1559. Only  the last 7 characters in each expect are matched.  A null expect, e.g. ~0
  1560. or two adjacent dashes, causes a short delay before proceeding to the next send
  1561. sequence.  A null expect always succeeds.
  1562.  
  1563. As  with  UUCP, if the expect string does not arrive, the script attempt fails.
  1564. If you expect that a sequence might not arrive, as with UUCP,  conditional  se-
  1565. quences may be expressed in the form:
  1566.  
  1567.     -send-expect[-send-expect[...]]
  1568.  
  1569. where dashed sequences are followed as long as previous expects fail.  Timeouts
  1570. for expects can be specified using ~w; ~w with no arguments waits 15 seconds.
  1571.  
  1572. expect-send transactions can be easily be  debugged  by  logging  transactions.
  1573. This  records  all  exchanges,  both expected and actual.  The script execution
  1574. will also be logged in the session log, if that is activated.
  1575.  
  1576. Note that `\' characters in login scripts, as in any other C-Kermit interactive
  1577. commands,  must  be doubled up.  A line may be ended with a single `\' for con-
  1578. tinuation.
  1579.  
  1580. Example one:
  1581.  
  1582. Using a modem, dial a UNIX host site.   Expect  "login"  (...gin),  and  if  it
  1583. doesn't come, simply send a null string with a ~r.  (Some Unixes require either
  1584. an EOT or a BREAK instead of the null sequence,  depending  on  the  particular
  1585. site's "logger" program.)  After providing user id and password, respond "x" to
  1586. a question-mark prompt, expect the Bourne shell "$" prompt (and send return  if
  1587. it  doesn't  arrive).   Then cd to directory kermit, and run the program called
  1588. "wermit", entering the interactive connect state after wermit is loaded.
  1589.  
  1590.     set modem ventel
  1591.     set line /dev/tty77
  1592.     set baud 1200
  1593.     dial 9&5551212
  1594.     script gin:--gin:--gin: smith ssword: mysecret ~q x $--$ \
  1595.      cd~skermit $ wermit
  1596.     connect
  1597.  
  1598. Note that 'set line' is issued after 'set modem',  but  before  'set  baud'  or
  1599. other line-related parameters.
  1600.  
  1601. Example two:
  1602.  
  1603. Using  a  modem,  dial the Telenet network.  This network expects three returns
  1604. with slight delays between them.  These are sent following null expects.    The
  1605. single return is here sent as a null string, with a return appended by default.
  1606. Four returns are sent to be safe before looking  for  the  prompt.    Then  the
  1607. Telenet  id and password are entered.  Then Telenet is instructed to connect to
  1608. a host site (c 12345).  The host has a data switch that  asks  "which  system";
  1609. the  script responds "myhost" (if the "which system" prompt doesn't appear, the
  1610. Telenet connect command is reissued).  The script waits for an "@" prompt  from
  1611. the  host,  then  sends  the user ID ("joe") and password ("secret"), looks for
  1612. another "@" prompt, runs Kermit, and in response to the Kermit's prompt  (which
  1613. ends  in  ">"),  gives  the commands "set parity even" and "server".  Files are
  1614. then exchanged.  The commands are in a take file; note the continuation of  the
  1615. 'script' command onto several lines using the `\' terminator.
  1616.  
  1617.     set modem hayes
  1618.     set line /dev/acu
  1619.     set speed 1200
  1620.     set parity mark
  1621.     dial 9,5551212
  1622.     script ~0 ~0 ~0 ~0 ~0 ~0 ~0 ~0 @--@--@ id~saa001122 = 002211 @ \
  1623.         c~s12345 ystem-c~s12345-ystem myhost @ joe~ssecret @ kermit \
  1624.         > set~sparity~seven > server
  1625.     send some.stuff
  1626.     get some.otherstuff
  1627.     bye
  1628.     quit
  1629.  
  1630. Since  these  commands may be executed totally in the background, they can also
  1631. be scheduled.  A typical shell script, which might be scheduled by cron,  would
  1632. be as follows (csh used for this example):
  1633.  
  1634.     #
  1635.     #keep trying to dial and log onto remote host and exchange files
  1636.     #wait 10 minutes before retrying if dial or script fail.
  1637.     #
  1638.     cd someplace
  1639.     while ( 1 )
  1640.             kermit < /tonight.cmd >> nightly.log &
  1641.             if ( ! $status ) break
  1642.             sleep 600
  1643.     end
  1644.  
  1645. File  tonight.cmd  might  have two takes in it, for example, one to take a file
  1646. with the set modem, set line, set baud, dial, and script, and a second take  of
  1647. a  file  with  send/get  commands  for  the  remote  server.  The last lines of
  1648. tonight.cmd should be 'bye' and 'quit'.
  1649.  
  1650.  
  1651.                             THE 'TRANSMIT' COMMAND:
  1652.  
  1653. Syntax: transmit fn1 [c]
  1654.  
  1655. Send the given file without error checking, obeying current settings  for  file
  1656. type (text or binary), parity, and duplex.
  1657.  
  1658. In  text  mode, send the file a line at a time, using the character c as a line
  1659. turnaround character.  That is, send a line  from  the  file,  wait  until  the
  1660. character  c comes in response, then send the next line, etc.  Linefeed (10) is
  1661. the default turnaround character.  If zero (0) is specified for the  turnaround
  1662. character,  then  send  the  whole file without waiting for any response.  Each
  1663. line is terminated by a carriage return, just as you would type it  at  a  ter-
  1664. minal.  The UNIX linefeed is stripped.  The computer to which you are transmit-
  1665. ting the file should be prepared to  receive  it,  for  instance  into  a  text
  1666. editor.
  1667.  
  1668. In binary mode, send all the characters of the file with no modification and no
  1669. line turnaround handshake.  Use binary mode only if you know that the  computer
  1670. or device to which you are transmitting the file can receive arbitrary patterns
  1671. of characters at full speed.
  1672.  
  1673. The 'transmit' command cannot be interrupted.
  1674.  
  1675.  
  1676.                               THE 'HELP' COMMAND:
  1677.  
  1678. Syntax: help
  1679.    or: help keyword
  1680.    or: help {set, remote} keyword
  1681.  
  1682. Brief help messages or menus are always available at interactive command  level
  1683. by  typing  a question mark at any point.  A slightly more verbose form of help
  1684. is available through the 'help' command.  The 'help' command with no  arguments
  1685. prints  a  brief  summary of how to enter commands and how to get further help.
  1686. 'help' may be followed by one of the top-level C-Kermit command keywords,  such
  1687. as  'send', to request information about a command.  Commands such as 'set' and
  1688. 'remote' have a further level of help.  Thus you may type 'help',  'help  set',
  1689. or  'help  set parity'; each will provide a successively more detailed level of
  1690. help.
  1691.  
  1692.  
  1693.                         THE 'EXIT' AND 'QUIT' COMMANDS:
  1694.  
  1695. These two commands are identical.  Both of them do the following:
  1696.  
  1697.    - Attempt to insure that the terminal is returned to normal.
  1698.    - Relinquish access to any communication line assigned via 'set line'.
  1699.    - Relinquish any uucp and multiuser locks on the communications line.
  1700.    - Hang up the modem, if the communications line supports data  terminal
  1701.      ready.
  1702.    - Close any open logs or other files.
  1703.  
  1704. After  exit  from C-Kermit, your default directory will be the same as when you
  1705. started the program.  The 'exit' command is issued implicitly whenever C-Kermit
  1706. halts normally, e.g. after a command line invocation, or after certain kinds of
  1707. interruptions.
  1708.  
  1709.  
  1710. 1.5. UUCP Lock Files
  1711.  
  1712. Unix has no standard way of obtaining exclusive  access  to  an  external  com-
  1713. munication  line.    When you issue the 'set line' command to Unix Kermit, Unix
  1714. would normally grant you access to the line  even  if  some  other  process  is
  1715. making  use  of  it.    The  method adopted by most Unix systems to handle this
  1716. situation is the "UUCP lock  file".    UUCP,  the  Unix-to-Unix  Copy  program,
  1717. creates  a  file  in  its  directory  (usually /usr/spool/uucp, on some systems
  1718. /etc/locks) with a name like LCK..name, where name is the device name, for  in-
  1719. stance tty07.
  1720.  
  1721. Unix Kermit uses UUCP lock files in order to avoid conflicts with UUCP, tip, or
  1722. other programs that follow this convention.  Whenever you attempt to access  an
  1723. external  line using the 'set line' command or `-l' on the command line, Kermit
  1724. looks in the UUCP directory for a lock file corresponding to that device.   For
  1725. instance, if you 'set line /dev/ttyi6' then Kermit looks for the file
  1726.  
  1727.     /usr/spool/uucp/LCK..ttyi6
  1728.  
  1729. If it finds this file, it gives you an error message and a directory listing of
  1730. the file so that you can see who is using it, e.g.
  1731.  
  1732.     -r--r--r--  1 fdc        8 Feb  7 13:02 /usr/spool/uucp/LCK..ttyi6
  1733.  
  1734. In this case, you would look up user fdc to find out how soon the line will be-
  1735. come free.
  1736.  
  1737. This  convention  requires  that  the  uucp  directory be publicly readable and
  1738. writable.  If it is not, the program will issue an appropriate warning message,
  1739. but will allow you to proceed at your own risk (and the risk of anyone else who
  1740. might also be using the same line).
  1741.  
  1742. If no lock file is found, Unix Kermit will attempt create one, thus  preventing
  1743. anyone  who subsequently tries to run Kermit, UUCP, tip, or similar programs on
  1744. the same line from gaining access until you release the line.  If Kermit  could
  1745. not  create  the  lock  file (for instance because the uucp directory is write-
  1746. protected), then you will receive a warning message  but  will  be  allowed  to
  1747. proceed  at  your  -- and everyone else's -- risk.  When Kermit terminates nor-
  1748. mally, your lock file is removed.
  1749.  
  1750. Even when the lock directory is writable and readable,  the  locking  mechanism
  1751. depends  upon  all  users using the same name for the same device.  If a device
  1752. has more than one path associated with it, then a lock can be  circumvented  by
  1753. using an alias.
  1754.  
  1755. When a lock-creating program abruptly terminates, e.g. because it crashes or is
  1756. killed via shell  command,  the  lock  file  remains  in  the  uucp  directory,
  1757. spuriously  indicating  that  the line is in use.  If the lock file is owned by
  1758. yourself, you may remove it.  Otherwise, you'll have to get the  owner  or  the
  1759. system manager to remove it, or else wait for a system task to do so; uucp sup-
  1760. ports a function (uuclean) which removes these files after a predetermined  age
  1761. -- uucp sites tend to run this function periodically via crontab.
  1762.  
  1763. Locking  is  not needed, or used, if communications occur over the user's login
  1764. terminal line (normally /dev/tty).
  1765.  
  1766. It may be seen that line locking is fraught with peril.  It is included in Unix
  1767. Kermit  only because other Unix communication programs rely on it.  While it is
  1768. naturally desirable to assure exclusive access  to  a  line,  it  is  also  un-
  1769. desirable  to  refuse  access  to a vacant line only because of a spurious lock
  1770. file, or because the uucp directory is not appropriately protected.
  1771.  
  1772.  
  1773. 1.6. File Attributes
  1774.  
  1775. New to version 4F of C-Kermit is the transmission and acceptance  of  file  at-
  1776. tributes.  For UNIX, C-Kermit sends the following attributes:
  1777.  
  1778.    - File size, in K.
  1779.  
  1780.    - Exact  file size, in bytes.  File sizes are based on the UNIX conven-
  1781.      tion for storing text files with a single LF terminating  each  line.
  1782.      If  a  UNIX  text file is sent to a different kind of system (e.g. an
  1783.      MS-DOS system, where text files are stored with CRLF at  the  end  of
  1784.      each line), the file may grow in size.
  1785.  
  1786.    - File creation date.
  1787.  
  1788.    - System identifier "U1" (UNIX).
  1789.  
  1790.    - File  type,  "B8"  for  binary  files,  or  "AMJ" for ASCII text with
  1791.      records terminated by Carriage Return (Ctrl-M) and Linefeed (Ctrl-J).
  1792.  
  1793. Sending the file size allows the receiving Kermit to do two useful things:  (1)
  1794. include "percent done" in its file transfer display, and (2) refuse the file in
  1795. case it is bigger than the available disk space.  If the receiving system  uses
  1796. the  file refusal mechanism in response to UNIX Kermit's attribute packet, UNIX
  1797. Kermit will not send the file.
  1798.  
  1799. When receiving files, UNIX Kermit reads and stores the file's attributes in  an
  1800. internal  structure.    These may be viewed in the debug log (see 'set debug').
  1801. In this release, all incoming attributes are ignored except File-Type and  Dis-
  1802. position.    The  file  type attribute does the equivalent of a "set file type"
  1803. command for the associated file, temporarily  overriding  the  prevailing  file
  1804. type.    If  the  Disposition  is "mail" (because the file was sent to C-Kermit
  1805. using a MAIL command instead of a SEND command), then the file will  be  mailed
  1806. to  the specified user, instead of being stored on disk.  On BSD-based systems,
  1807. the mail will include the filename in the subject line; on  AT&T-based  systems
  1808. there  will  be no subject line.  If the Disposition is Print (because the user
  1809. gave a REMOTE PRINT command instead of a SEND command), then the file  will  be
  1810. printed, using any specified options.
  1811.  
  1812. If  the  exchange of attribute packets with the other Kermit program causes any
  1813. problems, then you may turn this feature off by issuing the  command  'set  at-
  1814. tributes off'.
  1815.  
  1816.  
  1817. 1.7. C-Kermit under Berkeley or System III/V Unix:
  1818.  
  1819. C-Kermit  may be interrupted at command level or during file transfer by typing
  1820. Control-C.  The program will perform its normal exit  function,  restoring  the
  1821. terminal and releasing any lock.  If a protocol transaction was in progress, an
  1822. error packet will be sent to the opposite  Kermit  so  that  it  can  terminate
  1823. cleanly.
  1824.  
  1825. C-Kermit  may  be invoked in the background ("&" on shell commmand line).  If a
  1826. background process is "killed", the user will have to manually remove any  lock
  1827. file  and  may  need  to  restore  the  modem.  This is because the kill signal
  1828. (kill(x,9)) cannot be trapped by Kermit.
  1829.  
  1830. During execution of a system command ('directory', 'cwd', or `!'), C-Kermit can
  1831. often  be returned to command level by typing a single Control-C.  (With System
  1832. III/V, the usual  interrupt  function  (often  the  DEL  key)  is  replaced  by
  1833. Control-C.)
  1834.  
  1835. Under  Berkeley  Unix  only:  C-Kermit may also be interrupted by ^Z to put the
  1836. process in the background.
  1837.  
  1838. Control-C, Control-Z, and Control-\ lose their normal functions during terminal
  1839. connection and also during file transfer when the controlling tty line is being
  1840. used for packet i/o.
  1841.  
  1842. If you are running C-Kermit in "quiet mode" in the foreground, then  interrupt-
  1843. ing  the  program  with a console interrupt like Control-C will not restore the
  1844. terminal to normal conversational operation.  This is because the  system  call
  1845. to  enable console interrupt traps will cause the program to block if it's run-
  1846. ning in the background, and the primary reason for quiet mode is to  allow  the
  1847. program  to  run  in  the background without blocking, so that you can do other
  1848. work in the foreground.
  1849.  
  1850. If C-Kermit is run in the background ("&" on shell commmand line), then the in-
  1851. terrupt  signal  (Control-C)  (and System III/V quit signal) are ignored.  This
  1852. prevents an interrupt signal intended for a foreground job (say a  compilation)
  1853. from being trapped by a background Kermit session.
  1854.  
  1855.  
  1856. 1.8. C-Kermit on the AT&T UNIX PC
  1857.  
  1858. For  Unix  PC  owners  here  are a couple of hints.  The name of the phone line
  1859. devices are /dev/ph0 and /dev/ph1. The RS232 serial port is /dev/tty000.
  1860.  
  1861. Dialing out with the internal modem:
  1862.  
  1863.     C-Kermit>set line /dev/ph0
  1864.     C-Kermit>set speed 1200
  1865.     C-Kermit>set modem att
  1866.     C-Kermit>dial (123) 555-1212
  1867.  
  1868. Or use /dev/ph1 for the second  phone  line.    Control-C  will  terminate  the
  1869. dialer.  The telephone line must be in the DATA state; C-Kermit will remind you
  1870. of this if it finds the line in VOICE state.
  1871.  
  1872. To connecting via the RS232C serial port, first you must  turn  off  the  login
  1873. processor  that  is  (or may be) associated with the port, then you can use the
  1874. port in the normal manner.
  1875.  
  1876.     $ /usr/bin/getoff.sh tty000
  1877.     $ kermit
  1878.     C-Kermit>set line /dev/tty000
  1879.     C-Kermit>set speed 9600
  1880.         (start doing work...)
  1881.         (after exiting C-Kermit you may type:)
  1882.     $ /usr/bin/geton.sh tty000
  1883.  
  1884. You may omit the getoff/getoff lines if the line is not used for logging in.
  1885.  
  1886.  
  1887. 1.9. C-Kermit under VAX/VMS
  1888.  
  1889. C-Kermit can be built using VAX-11 C to run under VMS.  Most  of  the  descrip-
  1890. tions  in this manual hold true, but it should be noted that as of this writing
  1891. the VMS support is not thoroughly tested, and no explicit  support  exists  for
  1892. the various types of VMS files and their attributes.
  1893.  
  1894.  
  1895. 1.10. C-Kermit on the Macintosh and other Systems
  1896.  
  1897. The  "protocol kernel" of C-Kermit is also used by Columbia's Macintosh Kermit.
  1898. The user and system interface is  entirely  different,  and  is  covered  in  a
  1899. separate document.
  1900.  
  1901. There  is  also  a Kermit for the Commodore Amiga based on C-Kermit, as well as
  1902. versions for MS-DOS, Data General operating systems, etc.
  1903.  
  1904.  
  1905. 1.11. C-Kermit Restrictions and Known Bugs
  1906.  
  1907.    1. Editing characters:  The program's  interactive  command  interrupt,
  1908.       delete,  and  kill  characters are Control-C, Delete (or Backspace),
  1909.       and Control-U, respectively.  There is currently no  way  to  change
  1910.       them  to  suit your taste or match those used by your shell, in case
  1911.       those are different.
  1912.  
  1913.    2. Flow control:  C-Kermit attempts to use XON/XOFF flow control during
  1914.       protocol  operations,  but  it also puts the communication line into
  1915.       "rawmode".  On many systems, rawmode disables flow control, so  even
  1916.       though  you  may  have  "set flow xon/xoff", no flow control will be
  1917.       done.  This is highly system and Unix-version dependent.
  1918.  
  1919.    3. Modem controls:  If a connection is made over a  communication  line
  1920.       (rather  than  on  the controlling terminal line), and that line has
  1921.       modem controls, (e.g. data  terminal  ready  and  carrier  detection
  1922.       implementation),  returning  to  the shell level will disconnect the
  1923.       conversation.  In that case, one should use  interactive  mode  com-
  1924.       mands,  and  avoid use of piped shell-level operation (also see 'set
  1925.       modem-dialer' and 'dial' commands.)
  1926.  
  1927.    4. Login Scripts:  The present login scripts implementation follows the
  1928.       Unix conventions of uucp's "L.sys" file, rather than the normal Ker-
  1929.       mit "INPUT/OUTPUT" style.
  1930.  
  1931.    5. Dial-out vs dial-in  communications  lines:    C-Kermit  requires  a
  1932.       dial-out or dedicated line for the "set line" or "-l" options.  Most
  1933.       systems have some lines dedicated  to  dial-in,  which  they  enable
  1934.       "loggers"  on,  and  some  lines  available  for  dial-out.   Recent
  1935.       releases of Unix (ATT & Berkeley) have mechanisms for  changing  the
  1936.       directionality of a line.
  1937.  
  1938.    6. Using  C-Kermit  on  Local Area Networks:  C-Kermit can successfully
  1939.       operate at speeds up to 19200 baud over LANs, provided  the  network
  1940.       buffers are big enough to accommodate Kermit packets.
  1941.  
  1942.       When  computers  are connected to LANs through asynchronous terminal
  1943.       interfaces, then the connection should be configured to do  XON/XOFF
  1944.       flow  control between the network interface and the computer, rather
  1945.       than passing these signals through transparently.    This  can  help
  1946.       prevent  Kermit from overrunning the LAN's buffers if they are small
  1947.       (or if the LAN is congested), and will can also prevent the LAN from
  1948.       overrunning a slow Kermit's buffers.
  1949.  
  1950.       If  the network hardware cannot accept 100 characters at a time, and
  1951.       flow control cannot be done between the network  and  the  computer,
  1952.       then  Kermit's  "set send/receive packet-length" command can be used
  1953.       to shorten the packets.
  1954.  
  1955.    7. Resetting terminal after abnormal termination or kill: When C-Kermit
  1956.       terminates abnormally (say, for example, by a kill command issued by
  1957.       the operator) the user may need to reset the  terminal  state.    If
  1958.       commands  do  not  seem  to  be  accepted  at  the shell prompt, try
  1959.       Control-J "stty sane" Control-J  (use  "reset"  on  Berkeley  Unix).
  1960.       That  should  take  the  terminal  out of "raw mode" if it was stuck
  1961.       there.
  1962.  
  1963.    8. Remote host commands  may  time-out  on  lengthy  activity:    Using
  1964.       "remote  host"  to instruct the C-Kermit server to invoke Unix func-
  1965.       tions (like "make") that might take a long time  to  produce  output
  1966.       can cause timeout conditions.
  1967.  
  1968.    9. XOFF  deadlocks:    When  connecting back to C-Kermit after a trans-
  1969.       action, or after finishing the server, it may be necessary to type a
  1970.       Control-Q  to  clear  up  an  XOFF  deadlock.   There's not much the
  1971.       program can do about this...
  1972.  
  1973.   10. Long time to exit:  It takes C-Kermit several seconds to exit,  even
  1974.       on  a fast system.  This is because some time is necessary to ensure
  1975.       that restoration of the terminal line to its former  state  is  com-
  1976.       plete before closing it.
  1977.  
  1978.   11. Emergency  exit:    In interactive mode, the Ctrl-C Ctrl-C emergency
  1979.       exit terminates the program rather than going  back  to  the  inter-
  1980.       active prompt.
  1981.  
  1982.   12. Filename  syntax:  In interactive mode, fancy metacharacters and ex-
  1983.       pressions are not accepted in filenames within commands.
  1984.  
  1985.  
  1986. 1.12. How to Build C-Kermit for a Unix System
  1987.  
  1988. The C-Kermit files, as distributed from Columbia, all  begin  with  the  prefix
  1989. "ck".    You  should  make  a  directory  for these files and then cd to it.  A
  1990. makefile is provided to build C-Kermit for  various  Unix  systems  (there  are
  1991. separate  makefiles  for  VMS and the Macintosh).  As distributed, the makefile
  1992. has the name "ckuker.mak".  You should rename it to "makefile"  and  then  type
  1993. "make xxx", where xxx is the symbol for your system, for instance "make bsd" to
  1994. make C-Kermit for 4.x BSD Unix.  The result will be a program called  "wermit".
  1995. You  should test this to make sure it works; if it does, then you can rename it
  1996. to "kermit" and install it for general use.  See the makefile for a list of the
  1997. systems supported and the corresponding "make" arguments.
  1998.  
  1999.  
  2000. 1.13. Adapting C-Kermit to Other Systems
  2001.  
  2002. C-Kermit is designed for portability.  The level of portability is indicated in
  2003. parentheses after the module name: "C" means any system that has a  C  compiler
  2004. that conforms to the description in "The C Programming Language" by Kernighan &
  2005. Ritchie (Prentice-Hall, 1978).  "Cf" is like "C", but also requires  "standard"
  2006. features like printf and fprintf, argument passing via argv/argc, and so on, as
  2007. described in Kernighan & Ritchie.  "Unix" means the module should be useful un-
  2008. der  any  Unix  implementation;  it requires features such as fork() and pipes.
  2009. Anything else means that the module is  particular  to  the  indicated  system.
  2010. C-Kermit file names are of the form:
  2011.  
  2012. ck<system><what>.<type>
  2013.  
  2014. where the part before the dot is no more than 6 characters long, the part after
  2015. the dot no more than 3 characters long, and:
  2016.  
  2017. <type> is the file type:
  2018.  
  2019.   c:    C language source
  2020.   h:    Header file for C language source
  2021.   w:    Wart preprocessor source, converted by Wart (or Lex) to a C program
  2022.   nr:   Nroff/Troff text formatter source
  2023.   mss:  Scribe text formatter source
  2024.   doc:  Documentation
  2025.   ps:   Documentation, Postscript format
  2026.   hlp:  Help text
  2027.   bld:  Instructions for building the program
  2028.   bwr:  A "beware" file - list of known bugs
  2029.   upd:  Program update log
  2030.   mak:  Makefile
  2031.  
  2032. <system> is a single character to tell what system the file applies to:
  2033.  
  2034.   9:    OS-9
  2035.   a:    Descriptive material, documentation
  2036.   c:    All systems with C compilers
  2037.   d:    Data General
  2038.   h:    Harris computers (reserved)
  2039.   i:    Commodore Amiga (Intuition)
  2040.   m:    Macintosh
  2041.   o:    OS/2
  2042.   p:    IBM PC, PC-DOS (reserved)
  2043.   u:    Unix and Unix-like systems
  2044.   v:    VAX/VMS
  2045.   w:    Wart
  2046.  
  2047. <what> is mnemonic (up to 3 characters) for what's in the file:
  2048.  
  2049.   aaa:  A "read-me" file, like this one
  2050.   cmd:  Command parsing
  2051.   con:  Connect command
  2052.   deb:  Debug/Transaction Log formats, Typedefs
  2053.   dia:  Modem/Dialer control
  2054.   fio:  System-depdendent File I/O
  2055.   fns:  Protocol support functions
  2056.   fn2:  More protocol support functions
  2057.   ker:  General C-Kermit definitions, information, documentation
  2058.   mai:  Main program
  2059.   pro:  Protocol
  2060.   scr:  Script command
  2061.   tio:  System-dependent terminal i/o & control and interrupt handing
  2062.   usr:  User interface
  2063.   us2:  More user interface
  2064.   us3:  Still more user interface
  2065.  
  2066. Examples:
  2067.  
  2068. ckufio.c        File i/o for Unix
  2069. ckmtio.c        Terminal i/o for Macintosh
  2070. ckuker.mss      Scribe source for Kermit User Guide chapter
  2071. ckuker.nr       Nroff source file for Unix C-Kermit man page
  2072.  
  2073. On UNIX systems, use 'nroff -man ckuker.nr' to view the man  page,  or  install
  2074. the   file   in   the   man-page  area  with  the  appropriate  name  (e.g.  as
  2075. /usr/man/manl/kermit.l).
  2076.  
  2077. The following material discusses each of the C-Kermit modules briefly.
  2078.  
  2079. ckcmai.c, ckcker.h, ckcdeb.h (Cf):
  2080.     This  is  the  main program.  It contains declarations for global variables
  2081.     and a small amount of code to initialize some variables and invoke the com-
  2082.     mand  parser.    In  its distributed form, it assumes that command line ar-
  2083.     guments are passed to it via argc and argv.  Since this portion of code  is
  2084.     only several lines long, it should be easy to replace for systems that have
  2085.     different styles of user interaction.  The header files define symbols  and
  2086.     macros  used  by  the  various  modules  of C-Kermit.  ckcdeb.h is the only
  2087.     header file that is included by all the C-Kermit modules,  so  it  contains
  2088.     not  only  the  debug  format  definitions, but also any compiler-dependent
  2089.     typedefs.
  2090.  
  2091. ckwart.c (Cf), ckcpro.w (C):
  2092.     The  ckcpro module embodies the Kermit protocol state table and the code to
  2093.     accomplish state switching.  It is written in "wart", a language which  may
  2094.     be regarded as a subset of the Unix "lex" lexical analyzer generator.  Wart
  2095.     implements enough of lex to allow the ckprot module to function.   Lex  it-
  2096.     self  was not used because it is proprietary.  The protocol module ckcpro.w
  2097.     is read by wart, and a system-independent C program is produced.  The  syn-
  2098.     tax  of  a  Wart  program  is  illustrated by ckcpro.w, and is described in
  2099.     ckwart.doc.
  2100.  
  2101. ckcfns.c (C):
  2102.     The  module  contains  all  the Kermit protocol support functions -- packet
  2103.     formation, encoding, decoding, block check calculation, filename  and  data
  2104.     conversion, protocol parameter negotiation, and high-level interaction with
  2105.     the communication line and file system.  To accommodate small systems, this
  2106.     module has been split into two -- ckcfns.c and ckcfn2.c.
  2107.  
  2108. ckutio.c:
  2109.     This module contains the system-dependent primitives for communication line
  2110.     i/o,  timers, and interrupts for the various versions of Unix.  Certain im-
  2111.     portant variables are defined  in  this  module,  which  determine  whether
  2112.     C-Kermit  is  by  default  remote  or local, what the default communication
  2113.     device is, and so forth.  The tio module maintains its own private database
  2114.     of  file descriptors and modes for the console terminal and the file trans-
  2115.     fer communication line so that other modules (like ckcfns or  the  terminal
  2116.     connect module) need not be concerned with them.  The variations among Unix
  2117.     implementations with respect to terminal  control  and  timers  are  accom-
  2118.     modated via conditional compilation.
  2119.  
  2120. ckufio.c:
  2121.     This module contains system-dependent primitives  for  file  i/o,  wildcard
  2122.     (meta  character)  expansion,  file existence and access checking, file at-
  2123.     tribute processing, and system command execution for the  various  versions
  2124.     of  Unix.    It  maintains  an  internal  database  of i/o "channels" (file
  2125.     pointers in this case) for the files C-Kermit cares about -- the input file
  2126.     (the  file which is being sent), the output file (the file being received),
  2127.     the various logs, the screen, and so forth.    This  module  varies  little
  2128.     among  Unix  implementations  except  for  the wildcard expansion code; the
  2129.     directory structure of 4.2bsd Unix is different from  that  of  other  Unix
  2130.     systems.  Again, variation among Unix systems is selected using conditional
  2131.     compilation.
  2132.  
  2133. ckuusr.h, ckuusr.c, ckuus2.c, ckuus3.c (Unix):
  2134.     This is the "user interface" for C-Kermit.  It includes the command parser,
  2135.     the screen output functions, and console input functions.  The command par-
  2136.     ser comes in two pieces -- the traditional Unix command line decoder (which
  2137.     is quite small and compact), and the interactive keyword parser  (which  is
  2138.     rather large).  This module is fully replacable; its interface to the other
  2139.     modules is very simple, and is explained at the  beginning  of  the  source
  2140.     file.    The  ckuusr  module  also  includes  code  to execute any commands
  2141.     directly which don't require the Kermit protocol -- local file  management,
  2142.     etc.    The  module  is rated "Unix" because it makes occasional use of the
  2143.     system() function.
  2144.  
  2145.     Note that while ckuusr is logically one module, it has been split  up  into
  2146.     three C source files, plus a header file for the symbols they share in com-
  2147.     mon.  This is to accommodate small systems that cannot handle big  modules.
  2148.     ckuusr.c  has  the  command  line and top-level interactive command parser;
  2149.     ckuus2.c has the help command and strings; ckuus3 has the  set  and  remote
  2150.     commands along with the logging, screen, and "interrupt" functions.
  2151.  
  2152. ckucmd.c, ckucmd.h (Cf):
  2153.     This is an interactive command parsing package developed for C-Kermit.   It
  2154.     is written portably enough to be usable on any system that has a C compiler
  2155.     that supports functions like printf.    The  file  name  parsing  functions
  2156.     depend  upon primitives defined in the fio module; if these primitives can-
  2157.     not be supplied for a certain system, then the filename  parsing  functions
  2158.     can  be deleted, and the package will still be useful for parsing keywords,
  2159.     numbers, arbitrary text strings, and so forth.  The style of interaction is
  2160.     the same as that found on the DECSYSTEM-20.
  2161.  
  2162. ckucon.c (Unix):
  2163.     This is the connect module.  As supplied, it should operate in any Unix en-
  2164.     vironment,  or  any  C-based environment that provides the fork() function.
  2165.     The module requires access to global variables  that  specify  line  speed,
  2166.     parity,  duplex,  flow  control,  etc,  and  invokes functions from the tio
  2167.     module to accomplish the desired settings and input/output,  and  functions
  2168.     from  the  fio module to perform session logging.  No terminal emulation is
  2169.     performed, but since standard i/o is used for  the  console,  this  may  be
  2170.     piped  through a terminal emulation filter.  The ckucon function may be en-
  2171.     tirely replaced, so long as the global settings are honored by its replace-
  2172.     ment.    PC implementations of C-Kermit may require the ck?con module to do
  2173.     screen control, escape sequence interpretation, etc, and may also  wish  to
  2174.     write special code to get the best possible performance.
  2175.  
  2176. ckudia.c (Unix):
  2177.     This is the dialer module.  As supplied, it handles Hayes, Ventel,  Penril,
  2178.     Racal-Vadic, and several other modems.
  2179.  
  2180. ckuscr.c (Unix):
  2181.     This is the login script  module.    As  supplied,  it  handles  uucp-style
  2182.     scripts.
  2183.  
  2184. Moving C-Kermit to a new system entails:
  2185.  
  2186.    1. Creating  a  new ck?tio module in C, assembler, or whatever language
  2187.       is most appropriate for system programming on the new  system.    If
  2188.       the  system  is  Unix-like,  then  support  may  be added within the
  2189.       ckutio.c module itself using conditional compilation.
  2190.  
  2191.    2. Creating a new ck?fio module, as above.
  2192.  
  2193.    3. If the system is not Unix-like, then a new ckuusr module may be  re-
  2194.       quired, as well as a different invocation of it from ckcmai.
  2195.  
  2196.    4. If  the  distributed connect module doesn't work or performs poorly,
  2197.       then it may be replaced.  For instance, interrupt-driven i/o may  be
  2198.       required, especially if the system doesn't have forks.
  2199.  
  2200. Those  who  favor  a  different  style  of  user/program  interaction from that
  2201. provided in ckuusr.c may replace the entire module, for instance with one  that
  2202. provides a mouse/window/icon environment, a menu/function-key environment, etc.
  2203.  
  2204. A few guidelines should be followed to maintain portability:
  2205.  
  2206.    - Keep  variable and function names to 6 characters or less.  Don't use
  2207.      identifiers that are distinguished  from  one  another  only  by  al-
  2208.      phabetic case.
  2209.  
  2210.    - Keep  modules  small.    For instance, on a PDP-11 it is necessary to
  2211.      keep the code segment of each module below 8K in order to  allow  the
  2212.      segment  mapping  to  occur which is necessary to run programs larger
  2213.      than 64K on a non-I-and-D-space machine.
  2214.  
  2215.    - Keep strings short; many compilers have restrictive maximum  lengths;
  2216.      128  is the smallest maximum string constant length we've encountered
  2217.      so far.
  2218.  
  2219.    - Keep (f,s)printf formats short.  If these exceed  some  compiler  de-
  2220.      pendent maximum (say, 128) memory will be overwritten and the program
  2221.      will probably core dump.
  2222.  
  2223.    - Do not introduce system dependencies into ckcpro.w or ckcfn*.c.
  2224.  
  2225.    - If a variable is a character, declare as CHAR, not  int,  to  prevent
  2226.      the  various sign extension and byte swapping foulups that occur when
  2227.      characters are placed in integer variables.
  2228.  
  2229.    - Remember that different systems may use different  length  words  for
  2230.      different  things.  Don't assume an integer can be used as a pointer,
  2231.      etc.
  2232.  
  2233.    - Don't declare static functions; these can wreak  havoc  with  systems
  2234.      that do segment mapping.
  2235.  
  2236.    - In  conditional  compilations expressions, use #ifdef and #ifndef and
  2237.      not #if, which is not supported by some compilers.  Also,  don't  use
  2238.      any  operators  in these expressions; many compilers will fail to un-
  2239.      derstand expressions like #ifdef FOO | BAR.  Also, don't put trailing
  2240.      tokens on #else's or #endif's (use /* comments */).
  2241.  
  2242.    - Don't define multiline macros.
  2243.  
  2244. In  general,  remember that this program will have to be compilable by old com-
  2245. pilers and runnable on small systems.
  2246. Index
  2247.  
  2248.           Attribute Packets   5
  2249.           Attributes   4, 5, 9
  2250.           Autodialer   6, 7
  2251.  
  2252.           Background   3, 5
  2253.           Binary Files   2, 4
  2254.  
  2255.           C-Kermit   1
  2256.  
  2257.           Dialout Modem   7
  2258.  
  2259.           Emergency Exit   1
  2260.  
  2261.           File Warning   1
  2262.  
  2263.           Hayes Modem   8
  2264.  
  2265.           IBM   7
  2266.  
  2267.           Man page   11
  2268.           Modem   7
  2269.  
  2270.           Nroff   11
  2271.  
  2272.           TELENET   8
  2273.  
  2274.           UNIX Kermit   1
  2275.           UNIX PC   10
  2276.           UUCP   1
  2277.  
  2278.           Warning   1
  2279.                                Table of Contents
  2280.  
  2281. 1. UNIX KERMIT                                                                1
  2282.  
  2283.    1.1. The Unix File System                                                  1
  2284.    1.2. File Transfer                                                         1
  2285.    1.3. Command Line Operation                                                1
  2286.    1.4. Interactive Operation                                                 3
  2287.    1.5. UUCP Lock Files                                                       9
  2288.    1.6. File Attributes                                                       9
  2289.    1.7. C-Kermit under Berkeley or System III/V Unix:                         9
  2290.    1.8. C-Kermit on the AT&T UNIX PC                                         10
  2291.    1.9. C-Kermit under VAX/VMS                                               10
  2292.    1.10. C-Kermit on the Macintosh and other Systems                         10
  2293.    1.11. C-Kermit Restrictions and Known Bugs                                10
  2294.    1.12. How to Build C-Kermit for a Unix System                             10
  2295.    1.13. Adapting C-Kermit to Other Systems                                  10
  2296.  
  2297. Index                                                                        13
  2298.