home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / convergent / ctkermdoc.txt < prev    next >
Text File  |  2020-01-01  |  55KB  |  1,303 lines

  1.  
  2. 1. CTOS KERMIT 
  3.  
  4. Version:    2.0 
  5. Date:       January 1993 
  6.  
  7. This document is based on that of UNIX Kermit 4.2, modified for CTOS-Kermit. 
  8.  
  9. CTOS-Kermit is implementation of Kermit based on C-Kermit (Unix) Version 4.2, 
  10. written modularly and transportably in C. The protocol state transition table 
  11. is written in  wart,  a (not proprietary) lex-like preprocessor for C. 
  12. System-dependent primitive functions are isolated into separately compiled 
  13. modules so that the program  should be  easily portable among other systems. 
  14. Since this version is based on the original UNIX-Kermit source code, it 
  15. should not be used as a basis for new versions.  Rather, the original UNIX- 
  16. Kermit source code would be a better place to start. 
  17.  
  18.  
  19. CTOS-Kermit Capabilities At A Glance: 
  20.  
  21.   Local operation:                   Yes 
  22.   Remote operation:                  Yes 
  23.   Login scripts:                     Yes 
  24.   Transfer text files:               Yes 
  25.   Transfer binary files:             Yes 
  26.   Wildcard send:                     No 
  27.   File transfer interruption:        Yes 
  28.   Filename collision avoidance:      Yes 
  29.   Can time out:                      Yes 
  30.   8th-bit prefixing:                 Yes 
  31.   Repeat count prefixing:            Yes 
  32.   Alternate block checks:            Yes 
  33.   Terminal emulation:                Yes 
  34.   Communication settings:            Yes 
  35.   Transmit BREAK:                    Yes 
  36.   Support for dialout modems:        Yes 
  37.   IBM mainframe communication:       No 
  38.   Transaction logging:               Yes 
  39.   Session logging:                   Yes 
  40.   Debug logging:                     Yes 
  41.   Packet logging:                    Yes 
  42.   Act as server:                     Yes 
  43.   Talk to server:                    Yes 
  44.   Advanced server functions:         Yes 
  45.   Local file management:             Yes 
  46.   Command/Init files:                Yes 
  47.   UUCP and multiuser line locking:   No 
  48.   File attributes:                   No 
  49.   Command macros:                    No 
  50.   Raw file transmit:                 No 
  51.  
  52. CTOS-Kermit provides command line operation as well as interactive command 
  53. prompting and execution.  The command line options provide access to a 
  54. minimal subset of CTOS-Kermit's capabilities; the interactive command set 
  55. is far richer. 
  56.  
  57. On systems with dialout modems, CTOS-Kermit can use command files and login 
  58. scripts to automate remote system logins. 
  59.  
  60.  
  61. 1.1. The CTOS File System 
  62.  
  63. Consult your CTOS manual for details about the file system under your version 
  64. of CTOS.  For the purposes of Kermit, several things are worth briefly noting. 
  65. CTOS files have case-insensitive names.  CTOS directories are not tree- 
  66. structured.  Directory names are surrounded by "<>" characters.  For example, 
  67.  
  68.     <sys>foo.bar 
  69.  
  70. denotes  the file foo.bar in the directory <sys>.  Wildcard or "meta" 
  71. characters allow groups of files to be specified.  "*" matches any string; 
  72. "?" matches any single character. 
  73.  
  74. CTOS files are linear streams of 8-bit bytes.  Text files consist of 7-bit AS-
  75. CII characters, with the high bit off (0), and lines separated by the CTOS
  76. newline character, which is linefeed (LF, ASCII 10).  This distinguishes CTOS
  77. text files from those on most other ASCII systems, in which lines are
  78. separated by a carriage-return linefeed sequence (CRLF, ASCII 13 followed by
  79. ASCII 10).  Binary files are likely to contain data in the high bits of the
  80. file bytes, and are not treated in terms of lines.
  81.  
  82. When  transferring  files,  CTOS-Kermit  will convert between upper and lower 
  83. case filenames and between LF and CRLF line terminators automatically,  unless 
  84. told to  do  otherwise.   When binary files must be transferred, the program 
  85. must be instructed not to perform LF/CRLF conversion (-i on the command  line 
  86. or  "set file type" interactively; see below). 
  87.  
  88.  
  89. 1.2. Command Line Operation 
  90.  
  91. The CTOS-Kermit command line syntax rules that apply are: 
  92.  
  93.    - An option name is a single character. 
  94.    - Options are delimited by '-'. 
  95.    - Options with no arguments may be grouped (bundled) behind one delimiter. 
  96.    - Option-arguments cannot be optional. 
  97.    - Arguments immediately follow options, separated by whitespace. 
  98.    - The order of options does not matter. 
  99.  
  100. The following notation is used in command descriptions: 
  101.  
  102. fn1     A CTOS file specification which may not contain '*' or '?'. 
  103.  
  104. rfn     A remote file specification in the remote system's own syntax, which 
  105.         may denote a single file or a group of files.
  106.  
  107. rfn1    A remote file specification which should denote only a single file. 
  108.  
  109. n       A decimal number between 0 and 94. 
  110.  
  111. c       A decimal number between 0 and 127 representing the value of an ASCII 
  112.         character. 
  113.  
  114. cc      A decimal number between 0 and 31, or else exactly 127, representing 
  115.         the value of an ASCII control character. 
  116.  
  117. [ ]     Any field in square braces is optional. 
  118.  
  119. {x,y,z} Alternatives are listed in curly braces. 
  120.  
  121. CTOS-Kermit command line options may specify  either  actions  or  settings. 
  122. If CTOS-Kermit is invoked with a command line that specifies no actions, then 
  123. it will issue a prompt and begin interactive dialog.   Action  options 
  124. specify  either protocol transactions or terminal connection.  To invoke 
  125. CTOS-Kermit, run the 'run file' command at the system prompt.  Two prompts 
  126. will be displayed:  'File name' and '[Parameters]'.  kermit.run should be 
  127. entered at the first prompt.  Options may be entered at the second prompt. 
  128. the 'GO' key then invokes CTOS-Kermit. 
  129.  
  130. -s fn1  Send  the  specified  file. 
  131.  
  132.             File name    kermit.run 
  133.             [Parameters] -s foo.bar 
  134.  
  135. -r      Receive a file or files.  Wait passively for files to arrive. 
  136.  
  137. -k      Receive  (passively)  a file or files, sending them to standard output.
  138.         This option can be used in several ways: 
  139.  
  140.             File name    kermit.run 
  141.             [Parameters] -k 
  142.  
  143.         Displays  the  incoming  files  on  your screen; to be used only in 
  144.         "local mode" (see below). 
  145.  
  146. -a fn1  If you have specified a file transfer option, you may specify an alter-
  147.         nate name for a single file with the -a option.  For example, 
  148.  
  149.             File name    kermit.run 
  150.             [Parameters] -s foo -a bar 
  151.  
  152.         sends the file foo telling the receiver that its name is bar. 
  153.  
  154. -x      Begin server operation.  May be used in either local or remote mode. 
  155.  
  156. -O      Arguments specify commands to perform.  Commands may perform actions 
  157.         or specify settings. 
  158.  
  159. Actions specified on the command line are executed prior to any commands in 
  160. the .kermrc file.  If no action command is included, enter interactive dialog. 
  161. Commands specified with the -O option are executed after any commands in the 
  162. .kermrc file. 
  163.  
  164. Before proceeding, a few words about remote and local operation are  necessary.
  165. CTOS-Kermit  is  "local"  if it is running on PC or workstation that you are 
  166. using directly.  CTOS-Kermit is remote if it is running on another system and 
  167. transferring files over its own controlling terminal's communication line, 
  168. connected to your PC or workstation. 
  169.  
  170. If you are running CTOS-Kermit, it is in local mode by default,  with  the 
  171. "back  port"  designated for file transfer and terminal connection.  If you 
  172. are running Kermit on a multiuser (timesharing) system, it is in remote mode 
  173. unless  you explicitly point it at an external line for file transfer or 
  174. terminal connection.  The following command sets CTOS-Kermit's "mode": 
  175.  
  176. -l dev  Line -- Specify a terminal line to use for file transfer  and  terminal
  177.         connection, as in 
  178.  
  179.             File name    kermit.run 
  180.             [Parameters] -l [comm]a 
  181.  
  182. When  an  external  line is being used, you might also need some additional op-
  183. tions for successful communication with the remote system: 
  184.  
  185. -b n    Baud -- Specify the baud rate for the line given in the -l  option, as
  186.         in 
  187.  
  188.             File name    kermit.run 
  189.             [Parameters] -l [comm]a -b 9600 
  190.  
  191.         This  option  should  always  be included with the -l option, since  
  192.         the speed of an external line is not necessarily what you expect. 
  193.  
  194. -p x    Parity -- e,o,m,s,n (even, odd, mark, space, or none).   If parity is 
  195.         other than none, then the 8th-bit prefixing mechanism will be used for 
  196.         transferring 8-bit binary data, provided the opposite Kermit agrees. 
  197.         The default parity is even. 
  198.  
  199. -t      Specifies half duplex,  line  turnaround  with  XON  as the handshake 
  200.         character. 
  201.  
  202. The following commands may be used only with a CTOS-Kermit which is local  -- 
  203. either by default or else because the -l option has been specified. 
  204.  
  205. -g rfn  Actively  request  a remote server to send the named file or files; rfn
  206.         is a file specification in the remote host's own syntax. 
  207.  
  208. -f      Send a 'finish' command to a remote server. 
  209.  
  210. -c      Establish a terminal connection over  the  specified  or  default  com-
  211.         munication line, before any protocol transaction takes place.  Get back
  212.         to  the  local  system  by  typing  the  escape   character   (normally
  213.         GO) followed by the letter 'c'. 
  214.  
  215. -n      Like  -c,  but  after a protocol transaction takes place; -c and -n may
  216.         both be used in the same command.  The use of -n and -c is  illustrated
  217.         below. 
  218.  
  219. On  a  timesharing  system, the -l and -b options will also have to be included
  220. with the -r, -k, or -s options if the other Kermit is on a remote system. 
  221.  
  222. If CTOS-Kermit is in local mode, the screen (stdout)  is  continously  updated 
  223. to show  the  progress  of the file transer.  A dot is printed for every four 
  224. data packets, other packets are shown by type  (e.g.  'S'  for  Send-Init), 
  225. 'T'  is printed  when there's a timeout, and '%' for each retransmission.  In 
  226. addition, you may type (to stdin) certain "interrupt" commands during file
  227. transfer:  
  228.  
  229.     Control-F:  Interrupt the current File, and go on to the next (if any). 
  230.     Control-B:  Interrupt the entire Batch of files, terminate the transaction.
  231.     Control-R:  Resend the current packet 
  232.     Control-A:  Display a status report for the current transaction. 
  233.  
  234. These interrupt characters are used to be compatible with UNIX Kermit 
  235. interrupt characters. 
  236.  
  237. Several other command-line options are provided: 
  238.  
  239. -i      Specifies that files should be sent or received exactly "as is" with no
  240.         conversions.  This option is necessary for transmitting  binary  files.
  241.         It may also be used to slightly boost efficiency in CTOS-to-CTOS trans-
  242.         fers of text files by eliminating CRLF/newline conversion. 
  243.  
  244. -w      Write-Protect -- Avoid filename collisions for incoming files. 
  245.  
  246. -q      Quiet -- Suppress screen update during file transfer, for  instance  to
  247.         allow a file transfer to proceed in the background. 
  248.  
  249. -d      Debug -- Record debugging information in the file debug.log in the cur-
  250.         rent directory.  Use this option if you believe  the  program  is  mis-
  251.         behaving, and show the resulting log to your local kermit maintainer.
  252.  
  253. -h      Help -- Display a brief synopsis of the command line options.
  254.  
  255. The command line may contain no more than one protocol action option. 
  256.  
  257. Files are sent with their own names, except that lowercase letters are raised
  258. to upper, pathnames are stripped off, tilde ('~') characters changed to 'X',
  259. and if the file name begins with a period, an 'X' is inserted before it.  In-
  260. coming files are stored under their own names except that uppercase letters
  261. are lowered, and, if -w was specified, a "generation number" is appended to
  262. the name if it has the same name as an existing file which would otherwise be
  263. overwritten.  If the -a option is included, then the same rules apply to its
  264. argument.  The file transfer display shows any transformations performed
  265. upon filenames.
  266.  
  267. During transmission, files are encoded as follows: 
  268.  
  269.    - Control characters are converted to prefixed printables. 
  270.  
  271.    - Sequences  of repeated characters are collapsed via repeat counts, if 
  272.      the other Kermit is also capable of repeated-character compression. 
  273.  
  274.    - If parity is being used on the communication  line,  data  characters 
  275.      with  the  8th  (parity)  bit on are specially prefixed, provided the 
  276.      other Kermit is capable of 8th-bit prefixing (if  not,  8-bit  binary 
  277.      files cannot be successfully transferred). 
  278.  
  279.    - Conversion is done between CTOS newlines and carriage-return-linefeed 
  280.      sequences unless the -i option was specified. 
  281.  
  282.  
  283. Command Line Examples: 
  284.  
  285.     File name    kermit.run 
  286.     [Parameters] -l [comm]a -b 1200 -cnr 
  287.  
  288. This command connects you to the system on the other end of [comm]a at 1200 
  289. baud, where  you  presumably  log in and run Kermit with a 'send' command. 
  290. After you escape back, CTOS-Kermit waits for a file (or files) to arrive. 
  291. When  the  file transfer is completed, you are again connected to the remote 
  292. system so that you can logout. 
  293.  
  294.  
  295.     File name    kermit.run 
  296.     [Parameters] -l [comm]b -b 2400 -cntp m -ra foo 
  297.  
  298. This command is like the preceding one, except the remote system in this case
  299. uses half duplex communication with mark parity.  The first file that arrives
  300. is stored under the name foo.
  301.  
  302.     File name    kermit.run 
  303.     [Parameters] -l [comm] -b 9600 -c 
  304.  
  305. This example uses Kermit to connect your terminal to the system at the other
  306. end of [comm]a.
  307.  
  308.     File name    kermit.run 
  309.     [Parameters] -l [comm]a -b 9600 -nf 
  310.  
  311. This command would be used to shut down a remote server and then connect to
  312. the remote system, in order to log out or to make further use of it.  The -n
  313. option is invoked after -f (-c would have been invoked before).
  314.  
  315.  
  316.     File name    kermit.run 
  317.     [Parameters] -l [comm]a -b 9600 -qg foo.* 
  318.  
  319. This command causes CTOS-Kermit to get a group of files from a remote server.
  320. No display occurs on the screen, and the keyboard is not sampled for interrup-
  321. tion commands.
  322.  
  323.     File name    kermit.run 
  324.     [Parameters] -iwx 
  325.  
  326. This command starts up CTOS-Kermit as a server.  Files are transmitted with no
  327. newline/carriage-return-linefeed conversion; the -i option is necessary for
  328. binary file transfer and useful for CTOS-to-CTOS transfers.  Incoming files
  329. that have the same names as existing files are given new, unique names.
  330.  
  331.     File name    kermit.run 
  332.     [Parameters] -l [comm]a -b 9600 
  333.  
  334. This command sets the communication line and speed.  Since no action is
  335. specified, CTOS-Kermit issues a prompt and enters an interactive dialog with
  336. you.  Any settings given on the command line remain in force during the
  337. dialog, unless explicitly changed.
  338.  
  339.     File name    kermit.run 
  340.     [Parameters] 
  341.  
  342. This command starts up Kermit interactively with all default settings. 
  343.  
  344. A final example shows how CTOS Kermit might be invoked, then execute arbitrary 
  345. commands. 
  346.  
  347.     File name    kermit.run 
  348.     [Parameters] -O assign \\%A hello -O echo \\%A 
  349.  
  350. This causes kermit to assign the string "hello" to the variable \\%A, then
  351. echo that string to stdout.  Virtually any valid kermit command may be used
  352. with the -O option.
  353.  
  354. Exit Status Codes: 
  355.  
  356. Kermit returns an exit status of zero, except when a fatal error is encoun-
  357. tered, where the exit status is set to one.  The exit command may return a
  358. specific exit code.
  359.  
  360. 1.3  CTOS Interactive Commands 
  361.  
  362. CTOS-Kermit's interactive command prompt is "CTOS-Kermit>".  In response to 
  363. this prompt, you may type any valid command.  CTOS-Kermit executes the command 
  364. and then prompts you for another command.  The process continues until you 
  365. instruct the program to terminate. 
  366.  
  367. Commands  begin  with a keyword, normally an English verb, such as "send". 
  368. You may omit trailing characters from any keyword, so  long  as  you  specify 
  369. sufficient  characters  to  distinguish  it  from  any other keyword valid in 
  370. that field.  Certain commonly-used keywords (such as "send",  "receive", 
  371. "connect") have  special  non-unique abbreviations ("s" for "send", "r" for 
  372. "receive", "c" for "connect"). 
  373.  
  374. Certain characters have special functions in interactive commands: 
  375.  
  376.     ?   Question mark, typed at any point in a command, followed by a 
  377.         carriage return, will produce a message explaining  what  is 
  378.         possible or expected at that point.  Depending on the context, 
  379.         the message may be a brief phrase, a menu of keywords,  or a 
  380.         list of files. 
  381.  
  382.     ESC (The GO key)  --  Request  completion of the current keyword 
  383.         or filename, or insertion of a default value.  The result 
  384.         will be a beep if the requested operation fails. 
  385.  
  386.     DEL (The  Delete  or  Rubout key) -- Delete the previous character 
  387.         from the command.  You may also use BS (Backspace) for this 
  388.         function. 
  389.  
  390.     ^W  (Code-W) -- Erase the rightmost word from the command line. 
  391.  
  392.     ^U  (Code-U) -- Erase the entire command. 
  393.  
  394.     ^R  (Code-R) -- Redisplay the current command. 
  395.  
  396.     SP  (Space) -- Delimits fields (keywords, filenames, numbers) 
  397.         within a command.  HT (Horizontal Tab) may also be used for 
  398.         this purpose. 
  399.  
  400.     CR  (Carriage  Return)  -- Enters the command for execution.  LF 
  401.         (Linefeed) or FF (formfeed) may also be used for this purpose. 
  402.  
  403.     \   (Backslash) -- Enter any of the  above  characters  into  the 
  404.         command, literally.  To enter a backslash, type two 
  405.         backslashes in a row (\\). 
  406.  
  407. You  may  type  the editing characters (DEL, ^W, etc) repeatedly, to 
  408. delete all the way back to the prompt.  No action will be performed 
  409. until the  command  is entered by typing carriage return, linefeed, or 
  410. formfeed.  If you make any mistakes, you will receive an informative 
  411. error message and a new prompt  --  make liberal  use  of '?' and ESC 
  412. to feel your way through the commands.  One important command is 
  413. "help" -- you should use it the first time you run CTOS Kermit. 
  414.  
  415. Interactive CTOS Kermit accepts commands from files as well as from 
  416. the  keyboard. When  you  enter  interactive mode, CTOS-Kermit looks 
  417. for the file .kermrc in your current directory and executes any 
  418. commands it finds there.  These commands must be in interactive 
  419. format, not CTOS command-line format.  A "take" command is  also 
  420. provided  for use at any time during an interactive session.  Command 
  421. files may be nested to a depth of 20. 
  422.  
  423. Here is a brief list of CTOS Kermit interactive commands: 
  424.  
  425.       ask, askq  Prompt the user for a variable string. 
  426.          assign  Assign a string to a variable. 
  427.             bye  Terminate and log out a remote Kermit server. 
  428.           close  Close a log file. 
  429.         connect  Establish a terminal connection to a remote system. 
  430.             cwd  Change Working Directory. 
  431.            dial  Dial a telephone number. 
  432.          delete  Delete a local file. 
  433.       directory  Display a directory listing. 
  434.            echo  Display arguments literally. 
  435.            exit  Exit from the program, closing any open logs. 
  436.          finish  Instruct a remote Kermit server to exit, but not log 
  437.                  out. 
  438.             get  Get files from a remote Kermit server. 
  439.            goto  Go to a labeled command in a command file or macro. 
  440.          hangup  Hang up the phone or network connection. 
  441.            help  Display a help message for a given command. 
  442.              if  Conditionally execute the following command. 
  443.           input  Match characters from another computer against a given text. 
  444.             log  Open a log file -- debugging, packet, session, 
  445.                  transaction. 
  446.          output  Send text to another computer. 
  447.            quit  Same as 'exit'. 
  448.         receive  Passively wait for files to arrive. 
  449.          remote  Issue file management commands to a remote Kermit 
  450.                  server. 
  451.         reinput  Reexamine text previously received from another computer. 
  452.          script  Execute a expect, send sequence. 
  453.            send  Send files. 
  454.          server  Begin server operation. 
  455.             set  Set various parameters. 
  456.            show  Display values of 'set' parameters. 
  457.           space  Display current disk space usage. 
  458.      statistics  Display statistics about most recent transaction. 
  459.            take  Execute commands from a file. 
  460.  
  461. The 'set' parameters are: 
  462.      block-check  Level of packet error detection. 
  463.            count  Loop counter 
  464.            delay  How long to wait before sending first packet. 
  465.           duplex  Specify which side echoes during 'connect'. 
  466.    end-of-packet  Terminator for outbound packets. 
  467. escape-character  Character to prefix "escape commands" during 
  468.                       'connect'. 
  469.             file  Set various file parameters. 
  470.     flow-control  Communication line full-duplex flow control. 
  471.        handshake  Communication line half-duplex turnaround character. 
  472.             line  Communication line device name. 
  473.     modem-dialer  Type of modem-dialer on communication line. 
  474.    packet-length  Maximum length for packets. 
  475.    pad-character  Character to use for inter-packet padding. 
  476.          padding  How much inter-packet padding to use. 
  477.           parity  Communication line character parity. 
  478.           prompt  Change the CTOS-Kermit program's prompt. 
  479.            speed  Communication line speed. 
  480.  start-of-packet  Control character to mark beginning of packets. 
  481.        take echo  Take file command echo on/off 
  482.       take error  Take file termination on error on/off 
  483.          timeout  Timer interval to detect lost packets. 
  484.  
  485. The 'remote' commands are: 
  486.             cwd  Change remote working directory. 
  487.          delete  Delete remote files. 
  488.       directory  Display a listing of remote file names. 
  489.            help  Request help from a remote server. 
  490.            host  Issue a command to the remote host in its own command 
  491.                  language 
  492.           space  Display current disk space usage on remote system. 
  493.            type  Display a remote file on your screen. 
  494.             who  Display who's logged in, or get information about a 
  495.                  user. 
  496.  
  497. Most of these commands are described adequately in the Kermit User 
  498. Guide.  Special aspects of certain CTOS Kermit commands are described 
  499. below. 
  500.  
  501.  
  502.                               THE 'SEND' COMMAND 
  503.  
  504. Syntax:  send fn  - or -  send fn1 rfn1 
  505.  
  506. Send  the file or files denoted by fn to the other Kermit, which 
  507. should be running as a server, or which should be given the 'receive' 
  508. command.  Each file is sent  under  its own name (as described above, 
  509. or as specified by the 'set file names' command).  If the second form 
  510. is used, i.e. with fn1 denoting  a  single CTOS  file,  rfn1 may be 
  511. specified as a name to send it under.  The 'send' command may be 
  512. abbreviated to 's', even though 's' is not  a  unique  abbreviation 
  513. for a top-level CTOS-Kermit command. 
  514.  
  515. Note -- CTOS-Kermit sends only from the current or specified 
  516. directory.   It  does not traverse directory trees.  If the source 
  517. directory contains subdirectories, they will be skipped.  Conversely, 
  518. CTOS-Kermit does not  create  directories  when receiving  files. 
  519.  
  520.  
  521.                              THE 'RECEIVE' COMMAND 
  522.  
  523. Syntax:  receive  - or -  receive fn1 
  524.  
  525. Passively  wait  for files to arrive from the other Kermit, which must 
  526. be given the 'send' command -- the 'receive' command does not work in 
  527. conjunction with a server  (use  'get'  for  that).  If fn1 is 
  528. specified, store the first incoming file under that name.  The 
  529. 'receive' command may be abbreviated to 'r'. 
  530.  
  531.  
  532.                               THE 'GET' COMMAND: 
  533.  
  534. Syntax:  get rfn 
  535.  
  536.         or: get 
  537.                 rfn 
  538.                 fn1 
  539.  
  540. Request a remote Kermit server to send the named file or files.  Since 
  541. a remote file  specification  (or  list)  might  contain  spaces, 
  542. which normally delimit fields of a CTOS-Kermit command, an alternate 
  543. form of the command is  provided  to allow  the inbound file to be 
  544. given a new name: type 'get' alone on a line, and you will be prompted 
  545. separately for the remote and local  file  specifications, for example 
  546.  
  547.     CTOS-Kermit>get 
  548.      Remote file specification: foo 
  549.      Local name to store it under: bar 
  550.  
  551. As  with 'receive', if more than one file arrives as a result of the 
  552. 'get' command, only the first will be stored under the alternate name 
  553. given by fn1;  the remaining  files will be stored under their own 
  554. names if possible.  If a '?' is to be included in the remote file 
  555. specification, you must prefix it with '\' to suppress its normal 
  556. function of providing help. 
  557.  
  558.  
  559.                              THE 'SERVER' COMMAND: 
  560.  
  561. The 'server' command places CTOS-Kermit in "server mode" on the 
  562. currently selected communication line.  All further commands must 
  563. arrive as valid  Kermit  packets from  the  Kermit  on  the  other 
  564. end of the line.  The CTOS Kermit server can respond to the following 
  565. commands: 
  566.  
  567. Command                Server Response 
  568.   get                    Sends files 
  569.   send                   Receives files 
  570.   bye                    Attempts to log itself out 
  571.   finish                 Exits to level from which it was invoked 
  572.   remote directory       Sends directory lising 
  573.   remote delete          Removes files 
  574.   remote cwd             Changes working directory 
  575.   remote type            Sends files to your screen 
  576.   remote space           Reports about its disk usage 
  577.   remote who             Shows who's logged in 
  578.   remote host            Executes a remote shell command 
  579.   remote help            Lists these capabilities 
  580.  
  581. If  the  Kermit  server  is  directed at an external line (i.e. it is 
  582. in "local mode") then the console may be used for other work if you 
  583. have 'set  file  display  off'; normally the program expects the 
  584. console to be used to observe file transfers and enter status queries 
  585. or interruption commands. 
  586.  
  587.  
  588.                   THE 'REMOTE', 'BYE', AND 'FINISH' COMMANDS: 
  589.  
  590. CTOS-Kermit may itself request services from a remote Kermit server. 
  591. In  addition to the 'send' and 'get' commands, the following may also 
  592. be used: 
  593.  
  594.     remote cwd [directory] 
  595.         If the optional remote directory specification is included, 
  596.         you will be prompted  on a separate line for a password, which 
  597.         will not echo as you type it. 
  598.  
  599.     remote delete rfn       delete remote file or files. 
  600.     remote directory [rfn]  directory listing of remote files. 
  601.     remote host command     command in remote host's own command 
  602.                             language. 
  603.     remote space            disk usage report from remote host. 
  604.     remote type [rfn]       display remote file or files on the screen. 
  605.     remote who [user]       display information about who's logged in. 
  606.     remote help             display remote server's capabilities. 
  607.  
  608.     bye and finish: 
  609.         When  connected  to  a  remote  Kermit server, these commands 
  610.         cause the remote server to terminate; 'finish' returns it  to 
  611.         Kermit  or  system command  level  (depending on the 
  612.         implementation or how the program was invoked); 'bye' also 
  613.         requests it to log itself out. 
  614.  
  615.  
  616.                         THE 'LOG' AND 'CLOSE' COMMANDS: 
  617.  
  618. Syntax: log {debugging, packets, session, transactions} [ fn1 ] 
  619.  
  620. CTOS-Kermit's progress may be logged in various ways.  The 'log' 
  621. command  opens  a log,  the  'close' command closes it.  In addition, 
  622. all open logs are closed by the 'exit' and 'quit' commands.  A name 
  623. may be specified for a log file; if the name is omitted, the file is 
  624. created with a default name as shown below. 
  625.  
  626. log debugging 
  627.     This produces a voluminous log of the internal workings of CTOS- 
  628.     Kermit, of use to  Kermit developers or maintainers in tracking 
  629.     down suspected bugs in the CTOS-Kermit program.  Use of this 
  630.     feature dramatically slows down  the  Kermit protocol.  Default 
  631.     name: debug.log. 
  632.  
  633. log packets 
  634.     This produces a record of all the packets that go in and out  of 
  635.     the  communication port.  This log is of use to Kermit maintainers 
  636.     who are tracking down protocol problems in either CTOS-Kermit or 
  637.     any Kermit  that  CTOS-Kermit  is connected to.  Default name: 
  638.     packet.log. 
  639.  
  640. log session 
  641.     This log will contain a copy of everything you see on  your 
  642.     screen  during the  'connect' command, except for local messages 
  643.     or interaction with local escape commands.  Default name: 
  644.     session.log. 
  645.  
  646. log transactions 
  647.     The transaction log is a record of all the files that were sent or 
  648.     received while transaction logging was in effect.    It  includes 
  649.     time  stamps  and statistics,  filename  transformations,  and 
  650.     records of any errors that may have occurred.  The transaction log 
  651.     allows you to have long unattended file transfer  sessions 
  652.     without  fear  of  missing  some  vital screen message. 
  653.     Default name:  transaction.log. 
  654.  
  655. The 'close' command explicitly closes a log, e.g. 'close debug'. 
  656.  
  657.  
  658.                     LOCAL FILE MANAGEMENT COMMANDS: 
  659.  
  660. CTOS Kermit allows some degree of local file management from 
  661. interactive  command level: 
  662.  
  663. directory 
  664.     Displays a listing of the names, modes, sizes, and dates of files 
  665.     (which defaults to '*'). 
  666.  
  667. cwd [directory-name] 
  668.     Changes Kermit's working directory to the one given, or to the 
  669.     your default directory if the directory name is omitted. 
  670.     Equivalent to 'cd'. 
  671.  
  672. space 
  673.     Display information about disk space and/or quota in the current 
  674.     directory and device. 
  675.  
  676.  
  677.                         THE 'SET' AND 'SHOW' COMMANDS: 
  678.  
  679. Since Kermit is designed to allow diverse systems to communicate, it 
  680. is  often necessary  to  issue  special  instructions  to  allow  the 
  681. program to adapt to peculiarities of the another system or the 
  682. communication path.  These  instructions are accomplished by the 
  683. 'set' command.  The 'show' command may be used to display current 
  684. settings.  Here is a brief synopsis of  settings  available  in the 
  685. current release of CTOS-Kermit: 
  686.  
  687. block-check {1, 2, 3} 
  688.     Determines the level of per-packet error  detection.    "1"  is  a 
  689.     single-character  6-bit  checksum,  folded  to include the values 
  690.     of all bits from each character.   "2"  is  a  2-character,  12- 
  691.     bit  checksum.    "3"  is  a 3-character,  16-bit  cyclic 
  692.     redundancy check (CRC).  The higher the block check, the better 
  693.     the error detection and correction  and  the  higher  the 
  694.     resulting  overhead.   Type 1 is most commonly used; it is 
  695.     supported by all Kermit implementations, and it has proven 
  696.     adequate in  most  circumstances.  Types  2  or  3  would  be used 
  697.     to advantage when transferring 8-bit binary files over noisy 
  698.     lines. 
  699.  
  700. count n 
  701.     Provides for counted loops within Kermit script files.  The IF COUNT 
  702.     command decrements the count variable, and if the result is greater 
  703.     than zero, executes the following command.  A separate count 
  704.     variable is maintained for each take level. 
  705.  
  706. delay n 
  707.     How  many  seconds  to  wait before sending the first packet after 
  708.     a 'send' command.  Used in remote mode to give you time to escape 
  709.     back to your local Kermit and issue a 'receive' command.  Normally 
  710.     5 seconds. 
  711.  
  712. duplex {full, half} 
  713.     For use during 'connect'.  Specifies  which  side  is  doing  the 
  714.     echoing; 'full' means the other side, 'half' means CTOS-Kermit 
  715.     must echo typein itself. 
  716.  
  717. end-of-packet cc 
  718.     Specifies the control character needed by the other Kermit to 
  719.     recognize the end  of a packet.  CTOS-Kermit sends this character 
  720.     at the end of each packet. Normally 13 (carriage return), which 
  721.     most Kermit  implementations  require.  Other Kermits require no 
  722.     terminator at all, still others may require a different 
  723.     terminator, like linefeed (10). 
  724.  
  725. escape-character cc 
  726.     For use during 'connect' to get CTOS-Kermit's attention.  The 
  727.     escape character acts as a prefix to an 'escape command', for 
  728.     instance to close the  connection  and  return  to  CTOS-Kermit 
  729.     or  CTOS command level.  The normal escape character is Code-C. 
  730.  
  731. file {display, names, type, warning} 
  732.     Establish various file-related parameters: 
  733.     display {on, off} 
  734.         Normally 'on'; when in local mode, display progress of  file 
  735.         transfers on  the  screen (stdout), and listen to the keyboard 
  736.         (stdin) for interruptions.  If off (-q on command line) none 
  737.         of this is  done,  and  the file transfer may proceed in the 
  738.         background oblivious to any other work concurrently done at 
  739.         the console terminal. 
  740.  
  741.     names {converted, literal} 
  742.         Normally  converted,  which  mean  that  outbound  filenames 
  743.         have path specifications stripped, lowercase letters raised to 
  744.         upper, tildes  and extra  periods  changed  to X's, and an X 
  745.         inserted in front of any name that starts  with  period. 
  746.         Incoming  files  have  uppercase  letters lowered.  Literal 
  747.         means that none of these conversions are done; therefore, any 
  748.         directory path appearing in  a  received  file  specification 
  749.         must exist and be write-accessible.  When literal naming is 
  750.         being used, the sender should not use path names in the file 
  751.         specification  unless the same path exists on the target 
  752.         system and is writable. 
  753.  
  754.     type {binary, text} 
  755.         Normally text, which means that conversion is done between 
  756.         CTOS newline characters  and  the carriage-return/linefeed 
  757.         sequences required by the canonical Kermit file transmission 
  758.         format, and in common  use  on  non-CTOS  systems.   Binary 
  759.         means to transmit file contents without conversion.  Binary 
  760.         is necessary  for  binary file transfers. 
  761.  
  762.     warning {on, off} 
  763.         Normally  off,  which means that incoming files will silently 
  764.         overwrite existing files of the same name.  When on ('-w' on 
  765.         command line) Kermit will check if an arriving file would 
  766.         overwrite an existing file; if so, it will construct a new 
  767.         name for the arriving file, of the form  foo~n, where foo is 
  768.         the name they share and n is a "generation number"; if foo 
  769.         exists, then the new file will be called foo~1.  If foo and 
  770.         foo~1  exist, the new file will be foo~2, and so on. 
  771.  
  772. flow-control {none, xon/xoff} 
  773.     Normally xon/xoff for full duplex flow control.  Should be set to 
  774.     'none' if the other system cannot do xon/xoff flow control. 
  775.  
  776. handshake {xon, xoff, cr, lf, bell, esc, none} 
  777.     Normally none.  Otherwise, half-duplex communication line 
  778.     turnaround  handshaking  is  done, which means CTOS Kermit will 
  779.     not reply to a packet until it has received the indicated 
  780.     handshake character or has timed out  waiting for it. 
  781.  
  782. line [device-name] 
  783.     The device name for the communication line to be used for file 
  784.     transfer and terminal connection, e.g. [comm]a.  If you specify 
  785.     a device name, Kermit will be in local mode, and you should 
  786.     remember to issue any other necessary 'set'  commands,  such as 
  787.     'set speed'.  If you omit the device name, Kermit will revert to 
  788.     its default mode of operation. 
  789.  
  790. modem-dialer {direct, hayes, ventel, racal} 
  791.     The type of modem dialer on the communication line.  "Direct" 
  792.     indicates either there is no dialout modem, or that if the line 
  793.     requires carrier detection  to  open,  then  'set  line'  will 
  794.     hang waiting for an incoming call.  "Hayes" and "Ventel" indicate 
  795.     that the subsequent 'set  line'  will prepare for a subsequent 
  796.     'dial' command for Hayes and Ventel dialers, respectively. 
  797.  
  798. packet-length n 
  799.     Specify  the  maximum  packet  length to use.  Normally 90. 
  800.     Shorter packet lengths can be useful on noisy lines, or with 
  801.     systems or front ends or networks  that  have  small  buffers. 
  802.     The shorter the packet, the higher the overhead, but the lower the 
  803.     chance of a packet being  corrupted  by  noise, and the less time 
  804.     to retransmit corrupted packets. 
  805.  
  806. pad-character cc 
  807.     CTOS-Kermit normally does not need to have incoming packets 
  808.     preceded with pad characters.    This  command allows CTOS-Kermit 
  809.     to request the other Kermit to use cc as a pad character.  Default 
  810.     cc is NUL, ASCII 0. 
  811.  
  812. padding n 
  813.     How many pad characters to ask for, normally 0. 
  814.  
  815. parity {even, odd, mark, space, none} 
  816.     Specify character parity for use in packets and terminal 
  817.     connection,  normally  none.    If  other  than none, CTOS-Kermit 
  818.     will seek to use the 8th-bit prefixing mechanism for transferring 
  819.     8-bit binary data, which can  be  used successfully  only  if  the 
  820.     other Kermit agrees; if not, 8-bit binary data cannot be 
  821.     successfully transferred. 
  822.  
  823. prompt [string] 
  824.     The  given  string  will  be  substituted for "CTOS-Kermit>" as 
  825.     this program's prompt.  If the string is omitted, the prompt will 
  826.     revert to "CTOS-Kermit>". 
  827.  
  828. retry n 
  829.     Specify how many packet retries to attempt before giving up. 
  830.  
  831. speed {0, 110, 150, 300, 600, 1200, 1800, 2400, 4800, 9600} 
  832.     The  baud rate for the external communication line.  This command 
  833.     cannot be used to change the speed of your own console terminal. 
  834.     Many  CTOS  systems are set up in such a way that you must give 
  835.     this command after a 'set line' command before you can use the 
  836.     line. 
  837.  
  838. start-of-packet cc 
  839.     The Kermit packet prefix is Control-A (1).  The only reasons it 
  840.     should ever be changed would be: Some piece of equipment somewhere 
  841.     between the two Kermit  programs will not pass through a Cotrol- 
  842.     A; or, some piece of of equipment similarly placed is echoing its 
  843.     input.  In the latter case, the recipient of such an echo can 
  844.     change the packet prefix for outbound packets to be different from 
  845.     that of arriving packets, so that the  echoed  packets will  be 
  846.     ignored.  The opposite Kermit must also be told to change the 
  847.     prefix for its inbound packets.  CTOS  Kermit  presently  can  be 
  848.     told to change only its outbound packet prefix. 
  849.  
  850.  
  851. take { echo, error } { on, off } 
  852.     SET TAKE ECHO tells whether commands from a TAKE file are displayed on the 
  853.     screen as they are executed (off prevents command display).  SET TAKE
  854.     ERROR controls whether execution of a TAKE command file should be
  855.     terminated if an error occurs (off prevents termination).  In both cases,
  856.     on is the default. 
  857.  
  858. timeout n 
  859.     Normally, each Kermit partner sets its packet  timeout  interval 
  860.     based  on what the opposite Kermit requests.  This command allows 
  861.     you to override the normal procedure and specify a timeout 
  862.     interval.  If you specify 0, then no timeouts will occur, and CTOS 
  863.     Kermit will wait forever for expected packets to arrive. 
  864.  
  865.  
  866.                               THE 'SHOW' COMMAND: 
  867.  
  868. Syntax: show {parameters, versions, macros} 
  869.  
  870. The show command displays the values of  all  the  'set'  parameters 
  871. described above.    If  you  type 'show versions', then CTOS-Kermit 
  872. will display the version numbers and dates of all its internal 
  873. modules.    You  should  use  the  'show versions'  command  to 
  874. ascertain  the  vintage  of  your Kermit program before reporting 
  875. problems to Kermit maintainers.   The 'show macros' command displays 
  876. the values of all Kermit variables. 
  877.  
  878.  
  879.                            THE 'STATISTICS' COMMAND: 
  880.  
  881. The statistics command  displays  information  about  the  most 
  882. recent  Kermit protocol  transaction,  including  file  and 
  883. communication line i/o, as well as what encoding options were in 
  884. effect (such as 8th-bit  prefixing,  repeat-count compression). 
  885.  
  886.  
  887.                         THE 'TAKE' AND 'ECHO' COMMANDS: 
  888.  
  889. Syntax: take fn1 
  890.  
  891. The  'take' command instructs CTOS-Kermit to execute commands from the 
  892. named file. The file may contain any interactive CTOS-Kermit commands, 
  893. including 'take';  command  files  may  be nested to any reasonable 
  894. depth.  The 'echo' command may be used within command files to issue 
  895. greetings, announce progress, etc. 
  896.  
  897. Command files are in exactly the same syntax as  interactive 
  898. commands.    Note that  this implies that if you want to include 
  899. special characters like question mark or backslash that you would have 
  900. to quote with backslash when  typing  interactive  commands,  you 
  901. must  quote these characters the same way in command files. 
  902.  
  903. Command files may be used in lieu of command macros, which have now 
  904. been implemented in this version of CTOS-Kermit.  For instance, if you 
  905. commonly connect to a system called 'B' that is connected to [comm]a 
  906. at 4800 baud, you could  create  a file called b containing the 
  907. commands 
  908.  
  909.     set line [comm]a 
  910.     set speed 4800 
  911.     echo Connecting to System B... 
  912.     connect 
  913.  
  914. and  then simply type 'take b' (or 't b' since no other commands begin 
  915. with the letter 't') whenever you wished to connect to system B. 
  916.  
  917. For connecting to IBM mainframes, a number  of  'set'  commands  are 
  918. required; these, too, are conveniently collected into a 'take' file 
  919. like this one: 
  920.  
  921.     set speed 1200 
  922.     set parity mark 
  923.     set handshake xon 
  924.     set flow-control none 
  925.     set duplex half 
  926.  
  927. An  implicit  'take' command is executed upon your .kermrc file upon 
  928. CTOS-Kermit's initial entry into interactive dialog.  The .kermrc file 
  929. should  contain  'set' or  other  commands  you  want to be in effect 
  930. at all times.  For instance, you might want override the default 
  931. action when incoming files have the same  names as existing files -- 
  932. in that case, put the command 
  933.  
  934.     set file warning on 
  935.  
  936. in your .kermrc file. 
  937.  
  938. Commands executed from take files are echoed at the terminal if TAKE 
  939. ECHO has been set to ON.  Errors  encountered during execution of 
  940. take files (such as failure to complete dial or script operations) 
  941. cause termination of the current take file if TAKE ERROR has not been 
  942. set to OFF,  popping to  the take file that invoked it, or to 
  943. interactive level. 
  944.  
  945. A take file stack is maintained by Kermit which allows take files to 
  946. invoke other take files to a depth of 20. 
  947.  
  948.  
  949.                             THE 'POP' COMMAND: 
  950.  
  951. Syntax:  pop 
  952.  
  953. The POP command exits the current take file a returns execution control 
  954. to the take file that invoked the current take file, or to the interactive 
  955. level.  The pop command has no effect if it is executed from the 
  956. interactive command line. 
  957.  
  958.  
  959.                             THE 'CONNECT' COMMAND: 
  960.  
  961. The connect command links your terminal to another computer as if it 
  962. were a local  terminal to that computer, through the device specified 
  963. in the most recent 'set line' command, or through the default device 
  964. if your system  is  a  PC  or workstation.    All  characters you type 
  965. at your keyboard are sent out the communication line, all characters 
  966. arriving at the  communication  port  are  displayed  on  your 
  967. screen.  Current settings of speed, parity, duplex, and flow-control 
  968. are honored.  If you have issued a 'log  session'  command, 
  969. everything you  see  on  your  screen  will  also  be  recorded to 
  970. your session log.  This provides a way to "capture" files from systems 
  971. that don't have Kermit  programs available. 
  972.  
  973. To  get  back  to your own system, you must type the escape character, 
  974. which is "Code key" unless you have changed it with the 'set  escape' 
  975. command,   followed  by  a  single-character  command,  such  as  'c' 
  976. for  "command".  Single-character commands include: 
  977.  
  978.   c     Switch to command mode 
  979.   b     Send a BREAK signal 
  980.   0     (zero) send a null 
  981.   s     Give a status report about the connection 
  982.   Code  Send Code itself (whatever you  have  defined the  escape 
  983.         character to be, typed twice in a row sends one copy of it). 
  984.  
  985. Lowercase and control equivalents for these letters are also accepted. 
  986. A space typed after the escape character is ignored.  Any other 
  987. character will  produce a beep. 
  988.  
  989. The connect command simply displays incoming characters on the screen. 
  990. Any screen control sequences sent by the host will be handled by the 
  991. vt100 terminal emulator built in to CTOS-KERMIT. 
  992.  
  993.                               THE 'DIAL' COMMAND: 
  994.  
  995. Syntax: dial telephone-number-string 
  996.  
  997. This  command controls dialout modems.  The telephone-number-string 
  998. may contain modem-dialer commands, such as comma for Hayes pause, or 
  999. '&' for  Ventel  dial-tone wait and '%' for Ventel pause. 
  1000.  
  1001. Because  modem  dialers have strict requirements to override the 
  1002. carrier-detect signal most CTOS implementations expect, the sequence 
  1003. for dialing is more rigid than with the rest of kermit's features. 
  1004.  
  1005. Example one: 
  1006.  
  1007.     CTOS-Kermit>set modem-dialer hayes     hint: abbreviate set m h 
  1008.     CTOS-Kermit>dial 9W5551212 
  1009.     Connected! 
  1010.     CTOS-Kermit>set modem-dialer racal     hint: abbreviate set m r 
  1011.     CTOS-Kermit>dial 9W5551212 
  1012.     Connected! 
  1013.     CTOS-Kermit>connect                    hint: abbreviate c 
  1014.     logon, request remote server, etc. 
  1015.     CTOS-Kermit> ... 
  1016.     CTOS-Kermit>quit                       hint: abbreviate q 
  1017.  
  1018. this exits Kermit without hanging up the communications line. 
  1019.  
  1020. Example two: 
  1021.  
  1022.     kermit 
  1023.     CTOS-Kermit>set modem-dialer ventel 
  1024.     CTOS-Kermit>set line [comm]a 
  1025.     CTOS-Kermit>dial 9&5551212% 
  1026.     Connected! 
  1027.     CTOS-Kermit> ... 
  1028.  
  1029. Example three: 
  1030.  
  1031.     kermit 
  1032.     CTOS-Kermit>take my-dial-procedure 
  1033.     Connected! 
  1034.  
  1035.     file my-dial-procedure: 
  1036.     set modem hayes 
  1037.     set line [comm]a 
  1038.     dial 5551212 
  1039.     connect 
  1040.  
  1041. For  Hayes  dialers, two important switch settings are #1 and #6.  #1 
  1042. should be up so that the DTR is only asserted when the line is 'open'. 
  1043. #6 should  be  up so carrier-detect functions properly.  Switches #2 
  1044. (English versus digit result codes) and #4 (Hayes echoes modem 
  1045. commands) may be in either position. 
  1046.  
  1047. Note:    These examples are for Hayes and Ventel modems.  They are not 
  1048. applicable to the TACCS internal modem.  Dialing of the TACCS internal 
  1049. modem is accomplished through the use of scripts. 
  1050.  
  1051.  
  1052.                             THE 'HANGUP' COMMAND: 
  1053. Syntax: hangup 
  1054.  
  1055. The HANGUP command attempts to hang up the modem on a local-mode dialout 
  1056. connection established by SET LINE command in order to break the connection 
  1057. On terminal devices, Kermit accomplishes the hangup by momentarily turning 
  1058. off the Data Terminal Ready (DTR) RS-232 signal. 
  1059.  
  1060.  
  1061.                              THE 'SCRIPT' COMMAND: 
  1062.  
  1063. Syntax: script expect send [expect send] . . . 
  1064.  
  1065. "expect" has the syntax: expect[-send-expect[-send-expect[...]]] 
  1066.  
  1067. This command facilitates logging into a remote system and/or invoking 
  1068. programs or other facilities after login on a remote system.  More 
  1069. control over scripting may be attained by using the INPUT, REINPUT and 
  1070. OUTPUT commands. 
  1071.  
  1072. This  login  script facility operates in a manner similar to that 
  1073. commonly used by the Unix uucp System's "L.sys" file entries.  A login 
  1074. script is  a  sequence of the form: 
  1075.  
  1076.     expect send [expect send] . . . 
  1077.  
  1078. where  expect  is a prompt or message to be issued by the remote site, 
  1079. and send is the string (names, numbers, etc) to return.    The  send 
  1080. may  also  be  the keyword  EOT,  to send Code-D, or BREAK, to send 
  1081. a break signal.  Letters in send may be prefixed by '~' to send 
  1082. special characters.  These are: 
  1083.  
  1084.     ~b  backspace 
  1085.     ~s  space 
  1086.     ~q  '?'(trapped by Kermit's command interpreter) 
  1087.     ~n  linefeed 
  1088.     ~r  carriage return 
  1089.     ~t  tab 
  1090.     ~'  single quote 
  1091.     ~~  tilde 
  1092.     ~"  double quote 
  1093.     ~c  don't append a carriage return 
  1094.     ~o[o[o]] 
  1095.         an octal character 
  1096.  
  1097. As  with  some uucp systems, sent strings are followed by ~r unless 
  1098. they have a ~c. 
  1099.  
  1100. Only the last 7 characters in each expect are matched.  A null expect, 
  1101. e.g.  ~0 or two adjacent dashes, causes a short delay before 
  1102. proceeding to the next send sequence.  A null expect always succeeds. 
  1103.  
  1104. As with uucp, if the expect string does not arrive, the script 
  1105. attempt  fails. If  you  expect that a sequence might not arrive, as 
  1106. with uucp, conditional sequences may be expressed in the form: 
  1107.  
  1108.     -send-expect[-send-expect[...]] 
  1109.  
  1110. where dashed sequences are followed as long as previous expects fail. 
  1111.  
  1112. Expect/send transactions can be easily be  debugged  by  logging 
  1113. transactions. This records all exchanges, both expected and actual. 
  1114.  
  1115. Note that '\' characters in login scripts, as in any other CTOS-Kermit 
  1116. interactive commands, must be doubled up. 
  1117.  
  1118. Example one: 
  1119.  
  1120. Using a modem, dial a unix host site.   Expect  "login"  (...gin), 
  1121. and  if  it doesn't come, simply send a null string with a ~r.  (Some 
  1122. systems require either an EOT or a BREAK instead of the null sequence, 
  1123. depending  on  the  particular site's "logger" program.)  After 
  1124. providing user id and password, respond "x" to a question-mark prompt, 
  1125. expect the Bourne shell "$" prompt (and send return  if it  doesn't 
  1126. arrive).   Then cd to directory kermit, and run the program called 
  1127. "wermit", entering the interactive connect state after wermit is 
  1128. loaded. 
  1129.  
  1130.     set modem-dialer ventel 
  1131.     set line [comm]a 
  1132.     set baud 1200 
  1133.     dial 9&5551212 
  1134.     script gin:--gin:--gin: smith ssword: mysecret ~q x $--$ 
  1135.             cd~skermit $ wermit 
  1136.     connect 
  1137.  
  1138. Example two: 
  1139.  
  1140. Using a modem, dial the Telenet network.  This network  expects  three 
  1141. returns with  slight  delays between them.  These are sent following 
  1142. null expects.  The single return is here sent as a null string, with a 
  1143. return appended by default. Four  returns  are  sent  to  be  safe 
  1144. before looking for the prompt.  Then the telenet id and password are 
  1145. entered.  Then telenet is instructed to connect  to a  host  site  (c 
  1146. 12345).  The host has a data switch, and to "which system" it responds 
  1147. "myhost".  This is followed by a TOPS-20 logon, and a request to  load 
  1148. Kermit,  set even parity, and enter the server mode.  Files are then 
  1149. exchanged. The commands are in a take file.  The login command is 
  1150. split onto two lines for readability, though it is a single long line 
  1151. in the take file. 
  1152.  
  1153.     set modem-dialer hayes 
  1154.     set line [comm]a 
  1155.     set baud 1200 
  1156.     dial 9,5551212 
  1157.     set parity even 
  1158.     script ~0 ~0 ~0 ~0 ~0 ~0 ~0 ~0 @--@--@ id~saa001122 = 002211 @ 
  1159.         c~s12345 ystem-c~s12345-ystem myhost @ joe~ssecret @ kermit 
  1160.         > set~sparity~seven > server 
  1161.     send some.stuff 
  1162.     get some.otherstuff 
  1163.     bye 
  1164.     quit 
  1165.  
  1166.                            THE 'OUTPUT' COMMAND 
  1167.  
  1168. Syntax: output text 
  1169.  
  1170. Send the text to the serial port defined by a previous SET LINE.  The 
  1171. text can be any combination of plain ordinary characters, and backslash 
  1172. codes.  Backslash codes are decimal numbers preceeded by two backslashes. 
  1173. For example, //13 is the backslash code for carriage return.  Example: 
  1174.  
  1175.     output This is text to be output.//13//10 
  1176.  
  1177.  
  1178.                            THE 'INPUT' COMMAND 
  1179.  
  1180. Syntax: input timeout text 
  1181.  
  1182. Read responses from the other computer.  Wait up to timeout seconds for the 
  1183. specified text to appear.  If the text appears within the timeout interval, 
  1184. the command succeeds immediately.  Otherwise it fails.  The text can 
  1185. contain any combination of ordinary characters.  The maximum length of text 
  1186. is 7 bytes.  If text is longer than 7 bytes, the first 7 bytes are used. 
  1187. Example: 
  1188.  
  1189.      input 10 CONNECT 
  1190.  
  1191.  
  1192.                            THE 'REINPUT' COMMAND 
  1193.  
  1194. Syntax: reinput timeout text 
  1195.  
  1196. Searches response from the previous INPUT command for the given text. 
  1197. The timeout parameter is required but ignored.  The previous INPUT 
  1198. response is stored in an input buffer which is 300 characters long. 
  1199. Example: 
  1200.  
  1201.      reinput 10 BUSY 
  1202.  
  1203.  
  1204.                             THE 'IF' COMMAND: 
  1205.  
  1206. Syntax: if {success, failure, count, equal, defined, exist} command 
  1207.  
  1208. The IF command provides Kermit with a decision making mechanism to tell 
  1209. whether the following command should be executed bases on a given condition. 
  1210. The IF command supports a variety of conditions.  These are: 
  1211.  
  1212.     IF SUCCESS 
  1213.         If the previous command succeeded, execute the following command. 
  1214.  
  1215.     IF FAILURE 
  1216.         If the previous command failed, execute the following command. 
  1217.  
  1218.     IF COUNT 
  1219.         Execute the command if the result is greater than zero (see SET
  1220.         COUNT). The value of count is decremented after it is evaluated. 
  1221.  
  1222.     IF EQUAL 
  1223.        Execute the command if the two subsequent strings are equivalent. 
  1224.  
  1225.     IF DEFINED 
  1226.        Execute the command if the variable is non-null. 
  1227.  
  1228.     IF EXIST 
  1229.        Execute the command if the specified file exists. 
  1230.  
  1231.                              THE 'GOTO' COMMAND: 
  1232.  
  1233. Syntax: goto label_name 
  1234.  
  1235. Go to the command which follows the named label.  A label is a word 
  1236. beginning with a colon (:) on the left margin.  Example: 
  1237.  
  1238.      send test 
  1239.      if success goto GOOD 
  1240.      echo "Send failed" 
  1241.      goto FINISH 
  1242.      :GOOD 
  1243.      echo "Send completed successfully" 
  1244.      :FINISH 
  1245.      bye 
  1246.      exit 
  1247.  
  1248.  
  1249.  
  1250.                               THE 'HELP' COMMAND: 
  1251.  
  1252. Syntax: help 
  1253.    or: help keyword 
  1254.    or: help {set, remote} keyword 
  1255.  
  1256. Brief help messages or menus are always available at interactive 
  1257. command  level by  typing  a question mark at any point.  A slightly 
  1258. more verbose form of help is available through the 'help' command. 
  1259. The 'help' command with no  arguments prints  a  brief  summary of how 
  1260. to enter commands and how to get further help. 'help' may be followed 
  1261. by one of the top-level CTOS-Kermit command keywords,  such as 
  1262. 'send', to request information about a command.  Commands such as 
  1263. 'set' and 'remote' have a further level of help.  Thus you may type 
  1264. 'help',  'help  set', or  'help  set parity'; each will provide a 
  1265. successively more detailed level of help. 
  1266.  
  1267.  
  1268.                         THE 'EXIT' AND 'QUIT' COMMANDS: 
  1269.  
  1270. Syntax: exit 
  1271.     or: quit 
  1272.     or: exit exitstat 
  1273.     or: quit exitstat 
  1274.  
  1275. These two commands are identical.  Both of them do the following: 
  1276.  
  1277.    - Attempt to insure that the terminal is returned to normal. 
  1278.    - Relinquish access to any communication line assigned via 'set 
  1279.      line'. 
  1280.    - Close any open log files. 
  1281.    - If a positive numeric value is provided for 'exitstat', Kermit will 
  1282.      set an operating system exit status value that can be evaluated 
  1283.      by the next function to execute.  If 'exitstat' is not a positive 
  1284.      value or is not supplied, Kermit exits with a value of zero which 
  1285.      indicates a normal completion. 
  1286.  
  1287. Exit does not hangup the communication line. 
  1288.  
  1289. After  exit  from CTOS-Kermit, your default directory will be the same 
  1290. as when you started the program.  The 'exit' command is issued 
  1291. implicitly whenever CTOS-Kermit halts normally, e.g. after a command 
  1292. line invocation, or after certain kinds of interruptions. 
  1293.  
  1294.  
  1295. 1.7. How to Build CTOS-Kermit 
  1296.  
  1297. The CTOS-Kermit files, as distributed from Columbia, all  begin  with  the 
  1298. prefix "ct".  You should make a directory for these files and then set path 
  1299. to it.  The Workstation C compiler is used to compile .c files into .o files 
  1300. using the medium model.  A 'ctobjs' file is supplied, containing a list of 
  1301. all .o files.  To link, specify @ctobjs for the object modules, and @ctlibs 
  1302. (supplied) for libraries. 
  1303.