home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / old / ckermit60 / ckvker.hlp < prev    next >
Text File  |  2020-01-01  |  46KB  |  1,027 lines

  1. 1 KERMIT
  2. Kermit - File transfer & management, terminal connection, script programming
  3.  
  4. Written by:
  5.  
  6.   Frank da Cruz, Columbia University, with contributions from hundreds of
  7.   other volunteer programmers all over the world.  VMS particulars contributed
  8.   mainly by Terry Kennedy of Saint Peters College, New Jersey.  (Open)VMS help
  9.   topic by Alan Robiette, Oxford University (UK); Jim Barbour, University of
  10.   Colorado (USA); Christine M. Gianone and Frank da Cruz, Columbia University
  11.   (USA).  All references to VMS apply to both VMS and OpenVMS, VAX and Alpha.
  12.  
  13. Documentation:
  14.  
  15.   C-Kermit 6.0 is documented in the book "Using C-Kermit" by Frank da Cruz and
  16.   Christine M. Gianone, Digital Press / Butterworth-Heinemann, Woburn, MA,
  17.   USA, ISBN 1-55558-164-1.  Price: US $39.95.  Available in bookstores or
  18.   order directly from:
  19.  
  20.       Butterworth-Heinemann at +1 800 366-2665 (Visa, MC, Amex accepted).
  21.   or:
  22.       Columbia University at   +1 212 854-3703 (Visa, MC accepted).
  23.  
  24.   Sales of the documentation help to fund the Kermit development and support
  25.   effort.  Also, please consult the CKCKER.UPD file for information about
  26.   features (if any) that were added since the book was published.
  27.  
  28. Format:
  29.  
  30.   KERMIT  [ cmdfile ] [ option(s) ... ] [ file(s) ... ]
  31. 2 COMMANDS
  32. C-Kermit has a large vocabulary of commands; for a summary see the
  33. "COMMAND_LIST" subtopic.  All commands can be used either interactively,
  34. i.e.  typed in response to the "C-Kermit>" prompt, or placed in command
  35. files to be executed under the control of Kermit's programming language.
  36.  
  37. The SET and SHOW commands are particularly useful in that they are used
  38. to set and display respectively the many parameters governing Kermit's
  39. communication and file transfer capabilities.
  40. 3 BACKSLASH_NOTATION
  41. Within a command, \ is a special character to help you enter special
  42. quantities, or ordinary characters that would otherwise be illegal
  43. or hard to type.  At the end of a line, \ (backslash) makes the next
  44. line a continuation of the current line.  In all other circumstances
  45. the character following the \ identifies what the special item is:
  46.  
  47.   %          a user-defined simple (scalar) variable
  48.   &          an array reference
  49.   $          an environment variable
  50.   v (or V)   a built-in variable
  51.   m (or M)   a user-defined "long" variable
  52.   f (or F)   a function
  53.   d (or D)   a decimal (base 10) number
  54.   o (or O)   an octal (base 8) number
  55.   x (or X)   a hexadecimal (base 16) number
  56.   \          the backslash character itself
  57.   \b (or \B) the BREAK signal (OUTPUT command only)
  58.   \l (or \L) a long BREAK signal (OUTPUT command only)
  59.   A decimal digit (a 1-3 digit decimal number): see below
  60.   Anything else: following character taken literally
  61.  
  62. Numbers (in decimal, octal or hexadecimal format) turn into the
  63. character with that ASCII code, so you can use \7 for a bell, or
  64. \13 (or, say, \x0D) for a carriage return.
  65. 3 COMMAND_LIST
  66. You can use upper or lower case for commands.  Also, you can
  67. abbreviate commands as long as the abbreviation matches only one
  68. possibility.  This section gives a summary of C-Kermit's commands.
  69. For more information on each, please consult the user manual.  For
  70. brief instructions, type HELP and then the command name in
  71. response to the "C-Kermit>" prompt.
  72.  
  73. ;              Introduce a full-line or trailing comment (also #).
  74. @              Execute a DCL command.
  75. !              Synonym for @.
  76. :xxx           Introduce a label (GOTO target).
  77. ADD            Add a filespec to the SEND-LIST.
  78. ANSWER         Answer an incoming modem call.
  79. APC            Send an Application Program Command escape sequence.
  80. ASK            Prompt the user, store user's reply in a variable.
  81. ASKQ           Like ASK, but doesn't echo (useful for passwords).
  82. ASSIGN         Assign an evaluated string to a variable or macro.
  83. BEEP           Make a beep or bell noise.
  84. BUG            Display instructions for reporting bugs.
  85. BYE            Terminate and log out a remote Kermit server.
  86. CD             Change working directory (also CWD).
  87. CHECK          Check for availability of a given feature.
  88. CLEAR          Clear communication device input buffer.
  89. CLOSE          Close a log or other local file.
  90. COMMENT        Introduce a full-line comment.
  91. CONNECT        Establish a terminal connection to a remote computer.
  92. COPY           Copy a local file.
  93. DECLARE        Declare an array.
  94. DECREMENT      Subtract one (or other number) from a variable.
  95. DEFINE         Define a variable or macro.
  96. DELETE         Delete a file or files.
  97. DIAL           Dial a telephone number.
  98. DIRECTORY      Display a directory listing.
  99. DISABLE        Disallow access to selected features during server
  100.                operation.
  101. DO             Execute a macro.
  102. E-PACKET       Send an Error packet to the other Kermit.
  103. ECHO           Display text on the screen.
  104. ENABLE         Allow access to selected features during server
  105.                operation.
  106. END            End a command file or macro.
  107. EVALUATE       Print the value of an arithmetic expression.
  108. EXIT           Exit from the program, closing all open files and
  109.                devices.
  110. FINISH         Instruct a remote Kermit server to exit, but not
  111.                log out.
  112. FORWARD        Like GOTO, but only in the forward direction.
  113. FOR            Execute commands repeatedly in a counted loop.
  114. FTP            Run the system's FTP program.
  115. GET            Get files from a remote Kermit server.
  116. GETC           Get a character from the command terminal.
  117. GETOK          Ask a "yes/no" question (in scripts).
  118. GOTO           Go to a labeled command in a command file or macro.
  119. HANGUP         Hang up the phone or network connection.
  120. HELP           Display a help message for a given command.
  121. IF             Conditionally execute the following command.
  122. INCREMENT      Add one (or other number) to a variable.
  123. INPUT          Match characters from another computer against
  124.                a given text string.
  125. INTRODUCTION   Print a brief introduction to C-Kermit.
  126. LOCAL          (In macro defs) declare local variables.
  127. LOG            Open a log file - debugging, packet, session, or
  128.                transaction.
  129. LOOKUP         A name in the dialing or network directory.
  130. MAIL           Send a file as electronic mail to a specified
  131.                address.
  132. MINPUT         INPUT with multiple targets.
  133. MKDIR          Create a directory.
  134. MMOVE          Move (send then delete) multiple file groups.
  135. MOVE           Move (send then delete) files.
  136. MSEND          Send a list of files (multiple send).
  137. MSLEEP         Do nothing for given number of milliseconds.
  138. OPEN           Open a local file for reading or writing.
  139. OUTPUT         Send text to another computer.
  140. PAUSE          Do nothing for a given number of seconds.
  141. PDIAL          Partial DIAL
  142. PING           Check if an IP host is reachable.
  143. PRINT          Print a file on a local printer.
  144. PUSH           Invoke host system interactive command interpreter.
  145. PWD            Display current working device/directory.
  146. QUIT           Same as EXIT.
  147. READ           Read a line from a local file.
  148. RECEIVE        Passively wait for files to arrive.
  149. REDIAL         Redial the most recently dialed number.
  150. REINPUT        Reexamine text previously received from another
  151.                computer by an INPUT command.
  152. REMOTE         Issue commands to a remote Kermit server.
  153. RENAME         Change the name of a file.
  154. RETURN         Return from a user-defined function.
  155. RLOGIN         Make a TCP/IP Rlogin connection (privileged).
  156. RMDIR          Remove (delete) a directory.
  157. RUN            Run a program or system command.
  158. SCRIPT         Execute a UUCP-style login script.
  159. SEND           Send files.
  160. SERVER         Begin server operation.
  161. SET            Set various parameters.
  162. SHOW           Display values of SET parameters.
  163. SLEEP          Sleep (do nothing) for specified period.
  164. SPACE          Display current disk space usage.
  165. SPAWN          Synonym for RUN.
  166. STATISTICS     Display statistics about most recent transaction.
  167. STOP           Stop executing macro or command file and return
  168.                to the prompt.
  169. SWITCH         Execute one from a group of commands.
  170. TAKE           Execute commands from a file.
  171. TELNET         Make a TELNET connection to a TCP/IP host.
  172. TRANSLATE      Translate a file's character set.
  173. TRANSMIT       Upload a file with no error checking.
  174. TYPE           Display a file on the screen.
  175. UNDEFINE       Undefine a macro or variable.
  176. VERSION        Display the program version number on the screen.
  177. WAIT           Wait for the specified modem signals.
  178. WHILE          Execute commands repeatedly while a condition
  179.                is true.
  180. WHO            Display list of logged in users.
  181. WRITE          Write text to a local file.
  182. WRITELN        Write a line of text to a local file.
  183. XECHO          Echo text without supplying CRLF at the end.
  184. XIF            Extended IF command.
  185. 3 SET_Command
  186. Here are some of the parameters you can change with the SET
  187. command.  Note that some of these parameters require further
  188. specification.  E.g.  there are several RECEIVE parameters, so
  189. commands using SET RECEIVE look like "SET RECEIVE PACKET-LENGTH
  190. 1000".  See the manual or internal HELP command for details.
  191.  
  192. ALARM          A timer for use in scripts.
  193. ATTRIBUTES     Turn attribute packet processing on or off.
  194. BLOCK-CHECK    Level of packet error detection.
  195. BUFFERS        Size of send and receive packet buffers.
  196. CARRIER-WATCH  Treatment of carrier on serial connections.
  197. CASE           Treatment of alphabetic case in string comparisons.
  198. COMMAND        Command terminal settings, such as BYTESIZE.
  199. CONTROL-CHAR   Controls prefixing of individual control characters.
  200. COUNT          Initialization of IF COUNT loops.
  201. DEBUG          Log or display debugging information.
  202. DEFAULT        Synonym for CD.
  203. DELAY          How long to wait before sending first packet.
  204. DESTINATION    Where incoming files should go.
  205. DIAL           Parameters for telephone dialing.
  206. DUPLEX         Specify which side echoes during CONNECT.
  207. ESCAPE         Prefix for "escape commands" during CONNECT.
  208. EXIT           EXIT WARNING and EXIT STATUS.
  209. FILE           Set various file parameters.
  210. FLOW-CONTROL   Communication line full-duplex flow control.
  211. HANDSHAKE      Communication line half-duplex turnaround character.
  212. HOST           Specify network host name.
  213. INPUT          Control behavior of INPUT command.
  214. KEY            Key mapping during terminal connection.
  215. LANGUAGE       Enable language-specific character-set translations.
  216. LINE           Serial communication line device name.
  217. MACRO          Control aspects of macro execution.
  218. MODEM          Modem type and modem-specific parameters.
  219. NETWORK        Select type of network.
  220. PARITY         Communication line character parity.
  221. PORT           Synonym for LINE.
  222. PRINTER        Select printer device or file.
  223. PROMPT         The C-Kermit program's interactive command prompt.
  224. QUIET          Select message verbosity level.
  225. RECEIVE        Parameters for inbound packets.
  226. REPEAT         Control run-length compression in file transfers.
  227. RETRY          Packet retransmission limit.
  228. SCRIPT         Control SCRIPT command.
  229. SEND           Parameters for outbound packets.
  230.                See RECEIVE for subparameters.  Normally you need set
  231.                only RECEIVE parameters.  SEND parameters are
  232.                automatically set by the Kermit on the other end.
  233. SERVER         Parameters for server operation.
  234. SPEED          Communication line speed, e.g. 2400, 9600.
  235. TAKE           Control aspects of TAKE file execution.
  236. TCP            TCP protocol parameters.
  237. TELNET         TELNET protocol parameters.
  238. TERMINAL       Terminal parameters.
  239. TRANSFER       File transfer parameters.
  240. TRANSMIT       Control aspects of TRANSMIT command execution.
  241. UNKNOWN-CHAR   Specify handling of unknown character sets.
  242. WINDOW-SIZE    File transfer window size.
  243. 3 SHOW_Command
  244. The SHOW command displays the current values of Kermit parameters,
  245. programming constructs etc.  The usage is
  246.  
  247.   SHOW  [ category ]
  248.  
  249. where "category" may be any of the keywords listed below.  SHOW
  250. without any argument gives a summary of the most important
  251. parameters affecting communication and file transfer.  The available
  252. categories are as follows:
  253.  
  254. ALARM              SET ALARM value.
  255. ARGUMENTS          List of currently-defined macro arguments.
  256. ARRAYS             List of arrays defined.
  257. ATTRIBUTES         Settings (on or off) of individual attributes.
  258. CHARACTER-SETS     Current character-set selections.
  259. COMMUNICATIONS     Settings of line speed, parity etc.
  260. COMMAND            Command / console settings.
  261. COUNT              Value of COUNT variable
  262. DEFAULT            Default device and directory.
  263. DIAL               Settings for DIAL command.
  264. ESCAPE             Setting of escape character.
  265. EXIT               SET EXIT values.
  266. FEATURES           C-Kermit configuration features and options.
  267. FILE               Settings for file transfer parameters.
  268. FUNCTIONS          List of built-in functions.
  269. GLOBALS            List of "\%x" variables and their values.
  270. KEY                Value assigned to key subsequently pressed.
  271. LABELED-FILE-INFO  Settings of VMS attributes to be encapsulated.
  272. LANGUAGES          Languages available for SET LANGUAGE command.
  273. MACROS             Listings of currently-defined macros.
  274. MODEM              Modem type and modem-specific settings.
  275. NETWORK            Available network support and current connection.
  276. PRINTER            SET PRINTER values.
  277. PROTOCOL           Packet sizes and other protocol-related data.
  278. SCRIPTS            Settings in force for script programs.
  279. SERVER             Server functions and whether enabled.
  280. STATUS             SUCCESS or FAILURE of last command.
  281. TERMINAL           Settings of terminal bytesize, character set etc.
  282. TRANSMIT           Settings in force for TRANSMIT command.
  283. VARIABLES          List built-in variables and their values.
  284. VERSIONS           Versions of source modules used in compilation.
  285. 2 GENERAL_SYNOPSIS
  286. Kermit is a family of file transfer, management, and telecommunication
  287. programs available on many different computer operating systems and
  288. architectures.  Kermit programs transfer both text and binary files
  289. completely and correctly, and most Kermit programs include dial-out and
  290. terminal connection capability.  This help topic describes version 6.0 of
  291. C-Kermit, the Kermit program written in C for UNIX, (Open)VMS, OS/2, and
  292. several other computer systems.
  293.  
  294. Kermit is designed to help you communicate between two computers over
  295. dial-ups and other serial connections, and in most cases also over TCP/IP
  296. networks.  Once the connection is established, you can conduct a terminal
  297. session and you can transfer files.  To transfer files, you need to run
  298. Kermit on both computers.
  299.  
  300. Kermit is an "integrated" communications program.  It does the same thing
  301. as separate dial-out programs like CU, tip or VAXNET and file transfer
  302. programs such as Xmodem, NFT, or FTP.  It also has a script language,
  303. which you can use to automate communications tasks.  PC implementations
  304. of Kermit also have a terminal emulator built in.  The version of Kermit
  305. described in this help topic does not include a terminal emulator because
  306. most systems on which it is used don't need one.
  307.  
  308. Kermit has one major philosophical difference from most file transfer
  309. programs.  With programs such as Xmodem, in order to transfer a file you
  310. have to tell the program on the remote machine to send the file, then
  311. return to your local computer and tell it to receive the file.  For every
  312. file to be sent or received, you must give commands to both computers.
  313. Kermit can operate in this way too, but an alternative mode of use allows
  314. you to control all operations from your local computer.  In this mode the
  315. copy of Kermit on the remote machine acts as a "server".  Your local
  316. computer initiates all operations, sending the necessary commands to the
  317. remote Kermit.  In addition to transferring files, you can also tell
  318. Kermit to execute commands on the server, such as listing directories,
  319. deleting files, and even sending e-mail.
  320.  
  321. Normally you give Kermit commands interactively.  That is, to start
  322. Kermit, simply type the command "KERMIT" with no arguments.  Once Kermit
  323. has started up, it will prompt you for commands.  Kermit's command
  324. interpreter has good built-in help facilities.  If you use the same
  325. command sequences a lot, you can put them into files, and get Kermit to
  326. execute them automatically.  It is also possible to give Kermit commands
  327. by using options on the command line.  The options available are
  328. described in the "Parameters" section of this help topic.
  329.  
  330. Kermit's command language is too extensive to describe completely in a
  331. help topic, although other sections outline some of the facilities
  332. available.  See "Using C-Kermit" for complete documentation.
  333. 2 INITIALIZATION
  334. When C-Kermit starts, it executes commands from its initialization file.
  335. The search for the initialization file proceeds in the following order:
  336.  
  337.  1. If the "-Y" (uppercase) command-line option is given,
  338.     initialization-file processing is skipped.  Otherwise:
  339.  2. The file specified in the "-y" command-line option, if any.
  340.  3. The file CKERMIT_INI:CKERMIT.INI.
  341.  2. The file designated by the logical name CKERMIT_INIT.
  342.  3. The file SYS$LOGIN:CKERMIT.INI.
  343.  
  344. C-Kermit executes those commands before prompting you for interactive
  345. commands.  A typical initialization file might read as follows:
  346.  
  347.   SET RECEIVE PACKET 960
  348.   SET WINDOW 2
  349.   SET BLOCK 3
  350.  
  351. These commands set long packet sizes and a window size of 2 for
  352. receiving files, together with a strengthened checksum which is
  353. recommended for long packets.
  354. 2 KERMIT_HELP
  355. Kermit has extensive built-in help.  You can find out what commands
  356. exist by typing ? in response to the "C-Kermit>" prompt.  For commands
  357. that take multiple arguments, you can type ? wherever an argument is
  358. expected to see the possible choices; e.g. SET has many different
  359. things you can set, an example being SET RECEIVE PACKET-LENGTH 1000.
  360. You can type "SET ?", "SET RECEIVE ?", or "SET RECEIVE PACKET-LENGTH ?"
  361. to see the options available at each level.
  362.  
  363. You can type also HELP followed by the name of a command for fuller
  364. information on it; e.g. "HELP SET" gives information about the "SET"
  365. command in general, "HELP SET RECEIVE" tells about the SET RECEIVE
  366. command.
  367. 2 Command_Line_Options
  368. The full syntax of the KERMIT command is as follows:
  369.  
  370.   KERMIT  [cmdfile] [-x arg [-x arg]...[-yyy]...]] [= arg [arg ...]]
  371.  
  372. where:
  373.  
  374.   cmdfile is an optional command file to be executed after initialization,
  375.     -x  is an option requiring an argument,
  376.     -y  an option with no argument, and
  377.     arg is an argument word.
  378.   Words after the = sign are ignored by the program but made available
  379.   to the user in the array \&@[].
  380.  
  381. C-Kermit is often run without any command-line arguments or with just
  382. a command file, i.e. in one of the simpler variants:
  383.  
  384.   KERMIT
  385.  
  386. or:
  387.  
  388.   KERMIT cmdfile
  389.  
  390. Using this approach any Kermit parameters not set by the initialization
  391. file (see "INITIALIZATION" in this help topic), followed by those in
  392. "cmdfile" if present, may be set using interactive commands.
  393.  
  394. Command-line options provide a further way to set certain parameters
  395. and/or initiate certain actions for that particular invocation of
  396. Kermit.  This can be a useful short-cut in specific cases, e.g.
  397.  
  398.   KERMIT -s *.C
  399.  
  400. will start up Kermit, send all files with a filetype of .C in the
  401. current directory, and then exit.
  402.  
  403. From VMS, type the command "kermit -h" for a list of possible command-
  404. line options.  The principal ones are listed below.  The options are
  405. case-sensitive.  Upper-case options must be enclosed in doublequotes.
  406.  
  407. Settings:
  408.  
  409.   -l device    Communication line device
  410.   -j host      Network host name (if network support included)
  411.   -q           Be Quiet during file transfer
  412.   -i           Binary file transfer
  413.   -b rate      Line speed (baud rate), e.g. 1200, used with -l
  414.   -m name      Modem type, e.g. hayes
  415.   -p x         Parity, x = e, o, m, s, or n
  416.   -t           Half duplex, XON handshake
  417.   -e n         Receive packet length
  418.   -v n         Window size
  419.   -y name      Alternate initialization file name
  420.   -Y           Do not execute initialization file
  421.   -d           Log debug information to DEBUG.LOG
  422.   -B           For use in batch
  423.  
  424. Actions:
  425.  
  426.   -s files     Send files
  427.   -s -         Send files from standard input (SYS$INPUT)
  428.   -r           Receive files
  429.   -k           Receive files to standard output (SYS$OUTPUT)
  430.   -x           Enter server mode
  431.   -f           Finish remote server
  432.   -g files     Get remote files from server
  433.   -a name      Alternate file name, used with -s, -r, -g
  434.   -c           Connect (before file transfer, used with -l and -b)
  435.   -n           Connect (after file transfer, used with -l and -b)
  436.   -S           Stay (do not exit after executing action commands)
  437.  
  438. If no action command is included, enter interactive dialog.
  439. 2 SCRIPT_PROGRAMMING
  440. C-Kermit contains a powerful programming language, permitting complex
  441. sequences of Kermit instructions to be executed under the control of a
  442. user-supplied program.  The language features include simple variables,
  443. arrays, control structures, macros, and numeric and algebraic
  444. manipulations of variables including a range of built-in functions.
  445.  
  446. Programmed sequences of commands are stored in regular VMS files.  Such
  447. a program is executed by feeding the file to Kermit's command
  448. interpreter using the TAKE command,
  449.  
  450.   TAKE  command-file
  451.  
  452. The TAKE command may be issued as an interactive command at the
  453. "C-Kermit>" prompt.  In addition, an implicit TAKE command reads the
  454. initialization file when Kermit is started, followed by a further one if
  455. a command file name has been included as a command-line option: thus
  456. either of these files may include program sequences.
  457.  
  458. Command files may themselves contain TAKE commands.  Command files may
  459. be nested in this way to any reasonable depth.
  460. 3 CONTROL_STRUCTURES
  461. Kermit's programming language provides several means for writing
  462. loops and for conditional branching or transfer of control.  The
  463. principal control structures are summarized here.
  464.  
  465. Simple loops are constructed using the FOR command.  FOR loops take
  466. the form:
  467.  
  468.   FOR variable iv fv step { command, command, ... }
  469.     The FOR loop is controlled by a loop variable which is assigned
  470.     an initial value (iv), gets tested against a final value (fv),
  471.     and gets incremented by a step value.  If the step value is
  472.     positive, the loop exits when the loop variable is greater than
  473.     the final value.  If the step is negative, the loop exits when
  474.     the variable becomes less than the final value.
  475.  
  476. Conditional actions can be programmed using the IF, XIF ("extended
  477. if") or WHILE commands.  The syntax of these is as follows:
  478.  
  479.   IF [NOT] condition command1
  480.   [ELSE command2]
  481.  
  482.   XIF condition { command1, command2... } [ ELSE { command3, ... } ]
  483.  
  484.   WHILE condition { command1, command2... }
  485.  
  486.   SWITCH variable { :val1,commands,BREAK,:val1,commands,BREAK,... }
  487.  
  488. The simple IF can only execute one command if the condition is true;
  489. similarly the optional ELSE on the following line can only control
  490. one command.  XIF and its optional ELSE clause typically has
  491. multiple commands enclosed in the braces, as does the WHILE form of
  492. loop.  The XIF..[ELSE] and WHILE structures are each logically
  493. written all on one line, but may be spread over more than one actual
  494. line by use of the line continuation character - (hyphen).
  495.  
  496. The conditions for which it is possible to test, illustrated in the
  497. context of the IF command, include the following (see "Using C-Kermit"
  498. for a complete treatment):
  499.  
  500.   IF SUCCESS
  501.       The previous command succeeded.
  502.  
  503.   IF FAILURE
  504.       The previous command failed.
  505.  
  506.   IF DEFINED name
  507.       The named variable or macro is defined.
  508.  
  509.   IF COUNT
  510.       Subtract one from COUNT, execute the command if the result is
  511.       greater than zero (COUNT is a special variable used for simple
  512.       counted loops, initialized by SET COUNT).
  513.  
  514.   IF EXIST filename
  515.       The named file exists.
  516.  
  517.   IF NUMERIC variable
  518.       The variable's value is numeric.
  519.  
  520.   IF EQUAL s1 s2
  521.       s1 and s2 (character strings or string variables) are equal.
  522.  
  523.   IF LLT s1 s2
  524.       s1 is lexically (alphabetically) less than s2.  Use IF NOT LGT
  525.       for less-than-or-equal.
  526.  
  527.   IF LGT s1 s1
  528.       s1 is lexically (alphabetically) greater than s2.  Use IF NOT
  529.       LLT for greater-than-or-equal.
  530.  
  531.   IF = n1 n2
  532.       n1 and n2 (numbers or numeric variables) are equal.
  533.  
  534.   IF < n1 n2
  535.       n1 is arithmetically less than n2. Use IF NOT > for
  536.       less-than-or-equal.
  537.  
  538.   IF > n1 n2
  539.       n1 is arithmetically greater than n2\n.  Use IF NOT < for
  540.       greater-than-or-equal.
  541.  
  542. Various commands exist to transfer control to another part of the
  543. program.  These are often used in conjunction with a conditional of
  544. some nature.  Examples are
  545.  
  546.   GOTO label   Transfers control to the point in the program marked
  547.                by "label".  A label is a string preceded by a colon
  548.                (:) at the beginning of a line, thus
  549.  
  550.        IF < \x% 10 GOTO LESS
  551.           .
  552.           .
  553.        :LESS
  554.  
  555.   STOP         Stops execution of the program and returns control to
  556.                C-Kermit.
  557.  
  558.   END          Exits from a macro or command file, and returns to the 
  559.                point from which the macro or file was called (also 
  560.                RETURN, see documentation for details).
  561.  
  562.   BREAK        Exits unconditionally from closest enclosing FOR or
  563.                WHILE loop.
  564.  
  565.   CONTINUE     Forces jump to next iteration (if any) of closest
  566.                enclosing FOR or WHILE loop.
  567. 3 EXPRESSIONS
  568. The \Feval function allows the following operators in the
  569. expression to be evaluated.  The expression can use variables
  570. beginning with \%.  Syntax, precedences etc. are shown below:
  571.  
  572. Operator  Fix  Precedence   Operation         Example
  573.  
  574.  (   )             1        Group             (\%a + 3) * (\%1 - 5)
  575.    !      Post     2        Factorial         \%x! - (\%x - 2)!
  576.    ~      Pre      3        Logical NOT       ~\%n
  577.    -      Pre      3        Negative          -\%n
  578.    ^      In       4        Raise to power    2^\%p
  579.    *      In       5        Multiply          \%c * 5
  580.    /      In       5        Divide            \%c / 5
  581.    %      In       5        Modulus           \%c % 5
  582.    &      In       5        Logical AND       \%c & 5
  583.    +      In       6        Add               \%t + \%u
  584.    -      In       6        Subtract          127 - \%x
  585.    |      In       6        Logical OR        \%z | 4
  586.    #      In       6        Exclusive OR      \%z # 4
  587.    @      In       6        Greatest common   \%z @ 30
  588.                                divisor
  589. 3 FILE_HANDLING
  590. Kermit programs can read from and write to local files.  The
  591. relevant commands are OPEN, CLOSE, READ and WRITE.  The use of these
  592. is as follows:
  593.  
  594.   OPEN mode filename
  595.        "Mode" can be READ, WRITE or APPEND.  !READ and !WRITE are
  596.        also allowed; the meaning of these is to read from or write
  597.        to a VMS command rather than a physical file.  E.g. OPEN READ
  598.        KERMIT.DOC opens the (real) file KERMIT.DOC for reading,
  599.        while OPEN !READ DIR *.TXT requests the directory listing of
  600.        files with filetype .TXT as input.
  601.  
  602.   CLOSE mode
  603.        E.g. CLOSE READ, CLOSE WRITE etc.  Closes the file or
  604.        input/output stream defined by the mode name.
  605.  
  606.   READ variable-name
  607.        Reads a line of the file or command output, defined by the
  608.        OPEN READ or OPEN !READ statement, into the variable
  609.        specified.
  610.  
  611.   WRITE destination text-expression
  612.        Writes the information generated by "text-expression" to the
  613.        specified destination.  "Destination" may be FILE, which
  614.        writes to the file or output stream opened for writing by the
  615.        appropriate OPEN statement, but may also be any of the four
  616.        possible log files (DEBUG-LOG, PACKET-LOG, SESSION-LOG or
  617.        TRANSACTION-LOG).  "Text-expression" may contain text,
  618.        variable names, functions, expressions etc. and is evaluated
  619.        before writing.  WRITELN writes a "line" of text, or a text
  620.        record.  WRITE writes only the characters included in the text.
  621. 3 FUNCTIONS
  622. A range of built-in functions is provided in C-Kermit.  These are
  623. invoked via the general syntax \Fname(args).  From within C-Kermit
  624. they can be listed via the command SHOW FUNCTIONS.  See "Using C-Kermit"
  625. for a complete list, descriptions, examples, etc.
  626.  
  627.   \Fliteral(arg)     copy argument literally, no evaluation
  628.   \Fcharacter(arg)   return the character corresponding to
  629.                      number or numeric variable arg
  630.   \Fcode(arg)        return numeric code of character arg
  631.   \Fsubstr(a1,a2,a3) substring of a1, starting at a2, length a3
  632.   \Fright(a1,a2)     rightmost a2 characters of string a1
  633.   \Flower(arg)       convert to lower case
  634.   \Fupper(arg)       convert to upper case
  635.   \Freverse(arg)     reverse characters in string arg
  636.   \Frepeat(a1,a2)    repeat a1 a2 times
  637.   \Flpad(text,n,c)   left pad text to length n with char c
  638.   \Frpad(text,n,c)   right pad text to length n with char c
  639.   \Fexecute(m a)     execute macro named "m" with given
  640.                      parameters "a"
  641.   \Fcontents(v)      return current definition of variable
  642.   \Fdefinition(m)    return current definition of macro
  643.   \Flength(arg)      return the length of the string "arg"
  644.   \Findex(a1,a2,a3)  position of a2 in string a1, starting
  645.                      at position a3
  646.   \Ffiles(spec)      number of files matching file specification
  647.   \Fnextfile()       next file name from list in last \Ffiles
  648.   \Fmax(a1,a2)       maximum of two numbers
  649.   \Fmin(a1,a2)       minimum of two numbers
  650.   \Feval(expr)       evaluate arithmetic expression
  651. 3 MACROS
  652. C-Kermit allows macros.  A macro is a command that you define,
  653. composed of one or more other C-Kermit commands.  A typical macro is
  654. a list of Kermit commands, separated by commas.  For example:
  655.  
  656.   DEFINE SUN SET SPEED 9600, SET PARITY NONE, SET DUPLEX FULL,-
  657.   SET FLOW XON/XOFF
  658.  
  659. You call a macro by using its name, just like a normal command.  You
  660. can also call a macro using the DO command.  If you have given the
  661. DEFINE command above (or have it in your initialization file), then
  662. you can type SUN or DO SUN to execute all the commands in the
  663. definition.
  664.  
  665. Macros have normal names (i.e. not beginning with \).  You call them
  666. by using the name like a command.  If you put additional words on
  667. the same line as the macro invocation, these become arguments.
  668. Inside the macro, you can refer to the arguments as \%1, \%2, etc.
  669. For example:
  670.  
  671.   C-Kermit>DEFINE BSEND SET FILE TYPE BINARY, SEND \%1
  672.   C-Kermit>DEFINE TSEND SET FILE TYPE TEXT, SEND \%1
  673.   C-Kermit>BSEND KERMIT.EXE
  674.   C-Kermit>TSEND KERMIT.DOC
  675.  
  676. The number of arguments supplied can be referred to as \v(argc).  If
  677. you call another macro from a macro, the new one gets its own set of
  678. arguments, which do not interfere with the previous set.
  679. 3 SCRIPTED_COMMUNICATION
  680. The interactive command CONNECT and the escape sequence Ctrl-\ C,
  681. which normally switch the console terminal between the two
  682. computers, cannot be used in a scripted sequence.  Instead there are
  683. two commands, INPUT and OUTPUT, which control the dialog in the
  684. script context, supplemented by a few other commands.  Brief details
  685. are as follows:
  686.  
  687. OUTPUT text
  688.     Send the text to the other computer.
  689.  
  690. INPUT timeout text
  691.     Read responses from the other computer.  Wait up to "timeout"
  692.     seconds for the specified text to appear.  If the text appears
  693.     within the timeout interval, the command succeeds immediately.
  694.     Otherwise it fails.  Test with IF SUCCESS or IF FAILURE.
  695.  
  696. MINPUT timeout text1 text2 text3 ...
  697.     Like INPUT but looks for multiple targets simultaneously.
  698.  
  699. REINPUT timeout text
  700.     Searches previous responses from the computer for the given
  701.     text.  The timeout parameter is ignored.
  702.  
  703. ECHO [ text ]
  704.     Display the text on the local screen, followed by a newline.
  705.  
  706. CLEAR { INPUT, DEVICE, BOTH }
  707.     Clear any as-yet-unread characters from the communication
  708.     device's input buffer, the INPUT command buffer, or both.
  709.  
  710. PAUSE [ n ]
  711.     Do nothing for the indicated number of seconds, the default
  712.     being 1.
  713.  
  714. For further details of these and related commands, see the full
  715. documentation, "Using C-Kermit".  A special case of programmed terminal
  716. dialog, intended mainly for UUCP-style login sequences, is provided by
  717. the SCRIPT command.
  718. 4 SCRIPT_Command
  719. SCRIPT is a concise method for specifying a dialog between your system
  720. and another one.  There is also a more powerful general purpose script
  721. programming language, whose commands are described elsewhere in this
  722. help topic.  The SCRIPT command can be used for dialing, logging in,
  723. etc.  The syntax consists of strings separated by spaces.  The syntax is
  724.  
  725.   SCRIPT  expect send [expect send] . . .
  726.  
  727. Kermit waits until it sees the expect string, and then sends the send
  728. string.  If there are several pairs, it waits for each expect string,
  729. and then sends the send string.  (To specify a null expect string, i.e.
  730. to tell Kermit not to wait, use ~0 as the expect string.)  It normally
  731. waits up to 15 seconds for each expect string.  However ~w can be used
  732. to redefine this time.  If the expect string does not arrive, the script
  733. fails at that point.  If you want to be able to do something about
  734. failure, you can use conditional strings, of the form
  735.  
  736.   -send-expect[-send-expect[...]]
  737.  
  738. You can think of this as giving a list of things to try.  The first time
  739. one succeeds (i.e. an expected string arrives), the command terminates.
  740. At that point Kermit skips to the end of the dashed sequence.  If an
  741. expect fails, Kermit simply proceeds with the next send in the dashed
  742. sequence.
  743.  
  744. Within the strings, some special sequences can be used:
  745.  
  746.   ~b         backspace
  747.   ~s         space
  748.   ~q         `?' (trapped by Kermit's command interpreter)
  749.   ~n         linefeed
  750.   ~r         carriage return
  751.   ~t         tab
  752.   ~'         single quote
  753.   ~-         dash (hyphen)
  754.   ~~         tilde
  755.   ~"         double quote
  756.   ~x         XON (Control-Q)
  757.   ~c         don't append a carriage return
  758.   ~o[o[o]]   octal representation of an ASCII character code
  759.   ~d         delay approx 1/3 second during send
  760.   ~w[d[d]]   set wait for next expect to "dd" seconds
  761.   \\b        send a BREAK signal
  762.  
  763. Kermit sends a carriage return after each of the send strings
  764. unless the string has a ~c.
  765. 3 VARIABLES
  766. C-Kermit also lets you define variables.  Normal variables look like
  767. \%i, where i is a single letter.  The alphabetic case doesn't matter,
  768. i.e. \%a and \%A are the same variable.  Like macros, they are defined
  769. by DEFINE or ASSIGN.  All values are strings.  DEFINE gives a variable a
  770. fixed value.  ASSIGN computes a value and assigns it to the variable. To
  771. see the difference, look at
  772.  
  773.   DEFINE \%A Monday
  774.   DEFINE \%B Today is \%A
  775.   ASSIGN \%C Today is \%A
  776.   DEFINE \%A Tuesday
  777.   ECHO \%B
  778.   ECHO \%C
  779.  
  780. This will print "Today is Tuesday" then "Today is Monday".  The
  781. difference is that when defining \%C, the \%A is evaluated at the time
  782. of the definition, whereas when defining \%B, the variable name \%A
  783. itself is put in the definition.  It isn't evaluated until the command
  784. "ECHO \%B" is obeyed.
  785.  
  786. There are also arrays, which use \& instead of \%.  They are declared by
  787. DECLARE, e.g. DECLARE \&A[100].  Elements are referenced with
  788. subscripts, which may themselves be variables, and act like simple
  789. variables, e.g.
  790.  
  791.   DEFINE \&A[3] Tuesday
  792.  
  793. The first subscript of an array is [1].  You can destroy the array
  794. by making it zero size, e.g. DECLARE \&A[0].
  795. 4 PREDEFINED
  796. There are a number of built-in variables, which are referred to by
  797. \v(name).  They cannot be changed by the user.  To list these from
  798. within C-Kermit give the command SHOW VARIABLES.  See "Using C-Kermit"
  799. for a complete treatment.
  800.  
  801. \v(argc)       number of arguments passed to currently active macro.
  802. \v(args)       number of arguments passed to the program on the
  803.                command line.  The program argument vector is
  804.                assigned to the array \&@[].
  805. \v(cmdfile)    name of currently active command file, if any
  806. \v(cmdlevel)   current command level (command stack depth)
  807. \v(cmdsource)  source of current commands: prompt, macro, or file
  808. \v(count)      current value of COUNT (loop control via SET
  809.                COUNT, IF COUNT).
  810. \v(cpu)        CPU hardware type, if known, otherwise "unknown".
  811. \v(date)       current date in dd mmm yyyy format (e.g.  8 Feb 1992).
  812. \v(day)        current day of the week, e.g. Mon, Tue, Wed.
  813. \v(directory)  current device and/or directory.
  814. \v(exitstatus) current program exit status.
  815. \v(filespec)   file specification from most recent SEND, MSEND,
  816.                or GET command, or the name of the file most
  817.                recently received.
  818. \v(fsize)      size of last file transferred.
  819. \v(home)       user's home (login) directory name.
  820. \v(host)       local computer's hostname.
  821. \v(input)      current INPUT buffer contents.
  822. \v(line)       current communication device or network host name.
  823. \v(local)      1 if C-Kermit in local mode, 0 if in remote mode.
  824. \v(macro)      name of currently executing macro, if any.
  825. \v(ndate)      current date in numeric format, e.g. 19911225.
  826. \v(nday)       numeric day of the week: 0, 1, 2, ..., 6.
  827. \v(ntime)      current time in seconds since midnight, 0 through
  828.                86399.
  829. \v(platform)   name of specific machine or environment for which
  830.                C-Kermit was built.
  831. \v(program)    name of program (C-Kermit).
  832. \v(return)     value of most recent RETURN command.
  833. \v(speed)      transmission speed of current communication
  834.                device, if known.  (A spurious value of 38400
  835.                might be reported for pseudoterminals.)
  836. \v(status)     0 if the previous command succeeded, nonzero if
  837.                it failed.
  838. \v(system)     name of generic operating system for which
  839.                C-Kermit was built, such as UNIX or VMS.
  840. \v(tfsize)     total size of all files in the last group of
  841.                files that was transferred.
  842. \v(time)       current time in hh:mm:ss 24-hour clock format
  843.                (e.g. 13:45:23).
  844. \v(version)    numeric version number of C-Kermit.
  845. 2 TRANSFERRING_FILES
  846. To transfer files, Kermit must be run on both of the computers involved.
  847. Transfers may be carried out either by controlling both computers
  848. directly, or by putting one of them into "server" mode and controlling
  849. operations entirely from the other.
  850.  
  851. In the first method, one computer is given a SEND command, and the
  852. other with a corresponding RECEIVE command.  The user switches control
  853. from one computer to the other using:
  854.  
  855. (a) the CONNECT command - this switches control from the "local" system
  856.     (usually, but not necessarily, the microcomputer or workstation on
  857.     the user's desktop) to the "remote" system; and
  858.  
  859. (b) the "escape sequence" - this switches control from the remote system
  860.     back to the local system.  The escape sequence is normally Ctrl-\ C
  861.     (Control-backslash followed by "C") for C-Kermit, but Alt-X or
  862.     Ctrl-] C (Control-] followed by "C") for MS-DOS or OS/2 Kermit.
  863.  
  864. The second method using one of the Kermits as a server is described in
  865. the "SERVER_USAGE" sub-topic.
  866. 3 CHARACTER_SETS
  867. C-Kermit has the ability to send, receive and store files in a wide
  868. range of 7-bit and 8-bit character sets, including many which are
  869. designed for languages other than English.  Two character sets have to
  870. be distinguished: that which applies to the file as stored under VMS,
  871. and that used "on the wire" (i.e. the communications line or network
  872. connection) during file transfer.  These are set via the commands "SET
  873. FILE CHARACTER-SET" and "SET TRANSFER CHARACTER-SET" respectively.
  874.  
  875. The possible arguments for the SET FILE CHARACTER-SET command are:
  876.  
  877.  Name                   Bits   Script
  878.   ASCII                   7     Roman
  879.   BRITISH                 7     Roman
  880.   CANADIAN-FRENCH         7     Roman
  881.   CP437                   8     Roman, West European multinational
  882.   CP850                   8     Roman, West European multinational
  883.   CP852                   8     Roman, East European multinational
  884.   CP862                   8     Roman + Hebrew
  885.   CP866-CYRILLIC          8     Roman + Cyrillic
  886.   CYRILLIC-ISO            8     Roman + Cyrillic
  887.   DANISH                  7     Roman
  888.   DEC-KANJI              16     Roman + Japanese
  889.   DEC-MULTINATIONAL       8     Roman, West European multinational
  890.   DG-INTERNATIONAL        8     Roman, West European multinational
  891.   DUTCH                   7     Roman
  892.   FINNISH                 7     Roman
  893.   FRENCH                  7     Roman
  894.   GERMAN                  7     Roman
  895.   HEBREW-7                7     Roman + Hebrew
  896.   HEBREW-ISO              8     Roman + Hebrew
  897.   HP-ROMAN8               8     Roman
  898.   HUNGARIAN               7     Roman
  899.   ITALIAN                 7     Roman
  900.   JAPANESE-EUC           16     Roman + Japanese
  901.   JIS7-KANJI             16     Roman + Japanese
  902.   KOI8-CYRILLIC           8     Roman + Cyrillic
  903.   LATIN1-ISO              8     Roman, West European multinational
  904.   LATIN2-ISO              8     Roman, East European multinational
  905.   MACINTOSH-LATIN         8     Roman, West European multinational
  906.   NEXT-MULTINATIONAL      8     Roman, West European multinational
  907.   NORWEGIAN               7     Roman
  908.   PORTUGUESE              7     Roman
  909.   SHIFT-JIS-KANJI        16     Roman + Japanese
  910.   SHORT-KOI               7     Roman + Cyrillic
  911.   SPANISH                 7     Roman
  912.   SWEDISH                 7     Roman
  913.   SWISS                   7     Roman
  914.  
  915. The possible arguments for the SET TRANSFER CHARACTER-SET command
  916. are:
  917.  
  918.  Name                   Bits   Script
  919.   ASCII                   7     Roman
  920.   CYRILLIC-ISO            8     Roman + Cyrllic
  921.   HEBREW-ISO              8     Roman + Hebrew
  922.   JAPANESE-EUC           16     Roman + Japanese
  923.   LATIN1-ISO              8     Roman, West European Multinational
  924.   LATIN2-ISO              8     Roman, East European Multinational
  925.   TRANSPARENT 
  926.  
  927. where TRANSPARENT (the default) implies that no translation is
  928. attempted.  For translation between character sets involving accented or
  929. other foreign language characters, it will normally be necessary to use
  930. an 8-bit transfer character set such as LATIN1-ISO or CYRILLIC-ISO.
  931. 3 SERVER_USAGE
  932. Here's one way to use Kermit to transfer files.  It makes use of the
  933. "server" capability of VMS C-Kermit.  The procedure is as follows:
  934.  
  935.   + Run Kermit on your local (desktop) computer.
  936.  
  937.   + Establish connection to the VMS computer.  If your local
  938.     computer is running C-Kermit, and you are dialing with a modem,
  939.     then use the sequence SET MODEM <modem-name>, SET SPEED <rate>,
  940.     DIAL <number>.  If you are using MS-DOS or other Kermit that
  941.     lacks a DIAL command, carry on to the next step.
  942.  
  943.   + Set any other necessary communication parameters, such as PARITY,
  944.     DUPLEX, and FLOW-CONTROL.
  945.  
  946.   + Give the CONNECT command.  If you have a modem, but have not yet
  947.     dialed the VMS computer, type the modem dialing commands now.
  948.  
  949.   + Log in to VMS.
  950.  
  951.   + Start C-Kermit on VMS, and give it any desired SET commands for
  952.     file, communication, or protocol-related parameters.  If you
  953.     will be transferring binary files, give the command SET FILE
  954.     TYPE BINARY to the remote Kermit.
  955.  
  956.   + Give C-Kermit the SERVER command.
  957.  
  958.   + Escape back to the Kermit program on your local (desktop)
  959.     computer.  If your local computer is running C-Kermit, type
  960.     Ctrl-\ C (Control-backslash followed by the letter "C").  If
  961.     using MS-DOS Kermit, use Alt-X or Ctrl-] C.  You should now see
  962.     your local Kermit program's prompt.
  963.  
  964.   + If you will be transferring binary files, give the command SET
  965.     FILE TYPE BINARY.
  966.  
  967.   + Use GET followed by the filename to get files from VMS to your
  968.     local computer.  Use SEND followed by the filename to put files
  969.     from your local computer to VMS.  You may use "wildcard"
  970.     characters such as * and ? in the filenames to specify groups of
  971.     files.
  972.  
  973.   + When you finish transferring files, and you need to continue your
  974.     work on VMS, type FINISH and then CONNECT.  You're now talking to
  975.     C-Kermit on VMS.
  976.  
  977.   + If you don't need to go back to the remote computer again, type
  978.     the BYE command to the local Kermit program.  This will shut
  979.     down the remote Kermit server and terminate (log you off) your
  980.     VMS session.
  981. 3 VMS_SPECIFICS
  982. The standard Kermit file types of BINARY and TEXT should cope with
  983. most circumstances when files are transferred to or from VMS
  984. systems.  When sending, VMS files whose record organization is
  985. "Fixed" or "Undefined" are assumed to be BINARY; all other file
  986. types are assumed to be TEXT.
  987.  
  988. The default record length for binary files is 512 bytes.  This can
  989. be changed by the command "SET FILE RECORD-LENGTH n".
  990.  
  991. SET FILE TYPE LABELED is an option specific to VMS C-Kermit.  If
  992. invoked when sending a file, this causes the majority of the VMS
  993. file attributes to be encoded and sent as part of the file to the
  994. other system.  This information cannot be utilized by other (non-
  995. VMS) systems, but it is useful (a) for transmitting VMS file
  996. attributes between two different VMS systems; (b) for storing a file
  997. on a non-VMS system, while still allowing its attributes to be
  998. recreated when it is imported back into VMS.
  999.  
  1000. When sending or receiving a VMS file of type LABELED, set the file
  1001. type on the other system to BINARY.  Labeled files inported from
  1002. another system do not have their attributes recreated automatically:
  1003. an external utility CKVCVT is provided to do this.  A further
  1004. sub-topic describes the options available when running CKVCVT.
  1005. 4 CKVCVT
  1006. The CKVCVT utility regenerates VMS file attributes from a file
  1007. which has earlier been exported from VMS using the SET FILE TYPE
  1008. LABELED option.  Note that this is a completely separate program
  1009. from Kermit.  If desired it can be run from within Kermit by
  1010. giving a command of the form "! CKVCVT parameters".
  1011.  
  1012. Format
  1013.  
  1014.   CKVCVT  input-file [ options ]
  1015.  
  1016. The command-line options are as follows:
  1017.  
  1018.   -a        Preserve file ACL data (may require privileges)
  1019.   -b        Preserve file backup date
  1020.   -d        Print debugging information
  1021.   -f fn     Name output file fn instead of default
  1022.   -i        Inquire if a file is labeled
  1023.   -o        Preserve file ownership (requires privileges)
  1024.   -s        Strip one level of label information
  1025.   -t        Don't trim paths from output file name
  1026.   -?        Display this message
  1027.