home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / comm / ckermit.arc / ckuker.doc < prev    next >
Text File  |  1988-02-23  |  96KB  |  1,999 lines

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