BSD 4_4_Lite2 development
[unix-history] / usr / src / contrib / kermit-5A.188 / ckuker.nr
CommitLineData
361727e1
C
1.TH KERMIT 1C LOCAL
2.SH NAME
3kermit \- file transfer, terminal connection, character-set translation,
4and script programming
5.SH SYNOPSIS
6.B kermit
7[ options ...] [files ...]
8.SH DESCRIPTION
9.I Kermit
10is a family of file transfer, management, and communication software programs
11available for most computers and operating systems. The UNIX version of
12Kermit, called C-Kermit, supports serial connections (direct or dialed) and,
13in most UNIX implementations, also TCP/IP connections. On SunOS systems
14equipped with SunLink X.25, C-Kermit also supports X.25 connections.
15.PP
16C-Kermit's major functions are file transfer using the Kermit protocol,
17automatic dialing, terminal connection, translation of national and
18international character sets, and script programming for automated
19communications. This manual gives a brief overview of C-Kermit version
205A(188). C-Kermit is fully documented in the book
21.IR "Using C-Kermit"
22by Frank da Cruz and Christine M. Gianone, Digital Press, Burlington, MA,
23USA. Digital Press ISBN: 1-55558-108-0; Prentice-Hall ISBN: 0-13-037490-3.
24Price: US $34.95. In USA, call DECdirect at 1-800-344-4825, refer to order
25number EY-J896E-DP. Available: January 1993.
26.PP
27C-Kermit can be used in two "modes" -- remote and local. In remote mode,
28you connect to the UNIX system from a desktop PC, Macintosh, or workstation
29and transfer files between your desktop computer and UNIX C-Kermit. In that
30case, connection establishment (dialing, TELNET connection, etc) is handled
31by the Kermit program on your desktop computer.
32.PP
33In local mode, C-Kermit establishes a connection to another computer
34by direct serial connection, by dialing a modem, or by making a network
35connection. When used in local mode, C-Kermit gives you a terminal connection
36to the remote computer, using your actual terminal, emulator, or UNIX
37workstation window or console driver for specific terminal emulation.
38.PP
39C-Kermit also has two types of commands: the familiar UNIX-style command-line
40arguments, and an interactive dialog with prompt. Command-line arguments give
41you access to a small but useful subset of C-Kermit's features for terminal
42connection and file transfer, plus the ability to pipe files into or out of
43Kermit for transfer.
44.PP
45Interactive commands give you access to dialing, script programming,
46character-set translation, and in general, detailed control and display of all
47C-Kermit's features. Interactive commands can also be collected into command
48files or collected into macros.
49.PP
50.SH "STARTING C-KERMIT"
51.PP
52C-Kermit should be available as "kermit" somewhere in your PATH. To start
53C-Kermit simply type "kermit", possibly followed by command-line options. If
54there are no "action options" on the command line, C-Kermit starts in
55interactive mode; you will see a greeting message and then the "C-Kermit>"
56prompt. If you include action options on the command line, C-Kermit takes the
57indicated actions and then exits back to UNIX. Either way, C-Kermit
58executes the commands in its initialization file,
59.IR ".kermrc" ,
60in your home directory before it executes any other commands, unless you have
61included the -Y (uppercase) command-line option, which means to skip the
62initialization file.
63.PP
64.SH "USING C-KERMIT TO TRANSFER FILES"
65.PP
66Here is a common scenario for Kermit file transfer:
67.PP
68.in +0.5i
69.ll -0.5i
70.ta +0.2i
71.ti -0.2i
72\(bu Start Kermit on local computer and establish a connection to the
73remote computer. If C-Kermit is on your local
74computer, use the sequence SET MODEM <modem-name>, SET LINE, SET SPEED, and
75DIAL <number> if you are dialing; SET LINE and SPEED for direct connections,
76SET NETWORK and SET HOST (or, for TCP/IP, simply TELNET) for network
77connections.
78
79.ti -0.2i
80\(bu SET any other necessary communication parameters, such as PARITY,
81DUPLEX, and FLOW-CONTROL. If you will be communicating with an IBM mainframe
82in line-mode (not full-screen mode), give the command DO IBM.
83
84.ti -0.2i
85\(bu Give the CONNECT command.
86
87.ti -0.2i
88\(bu Log in to the remote computer.
89
90.ti -0.2i
91\(bu Start Kermit on the remote computer, give it any desired SET commands
92for file, communication, or protocol-related parameters. If you will be
93transferring binary files, give the command SET FILE TYPE BINARY to the remote
94Kermit.
95
96.ti -0.2i
97\(bu Give the remote Kermit the SERVER command.
98
99.ti -0.2i
100\(bu Escape back to the Kermit program on your local (desktop) computer.
101If your local computer is running C-Kermit, type Ctrl-\\ c (Control-backslash
102followed by the letter 'c') (on NeXT workstations, use Ctrl-] c). If MS-DOS
103or OS/2 Kermit, use Alt-X or Ctrl-] c. Now you should see your local Kermit
104program's prompt.
105
106.ti -0.2i
107\(bu If you will be transferring binary files, give the command SET FILE
108TYPE BINARY to your local Kermit program.
109
110.ti -0.2i
111\(bu To get files from the remote computer to your local computer, use GET
112followed by the filename. Use SEND followed by the filename to put files
113from your local computer to the remote system. You may use "wildcard"
114characters such as * and ? in the filenames to specify groups of files.
115
116.ti -0.2i
117\(bu When you finish transferring files, and you need to continue your work
118on the remote remote computer, type FINISH and then CONNECT. You're now
119talking Kermit on the remote computer again. Type EXIT to get back to the
120command prompt on the remote system. At the end, logout normally from the
121remote computer. Then escape back to Kermit on your local computer, and then
122EXIT from the local Kermit program.
123
124.ti -0.2i
125\(bu If you don't need to go back to the remote computer again, type the
126BYE command to the local Kermit program. This will shut down the remote
127Kermit server and terminate (log out) your remote session.
128.ll +0.5i
129.in -0.5i
130.fi
131.PP
132.SH HELP
133.PP
134Kermit has extensive built-in help. You can find out what commands exist by
135typing ? at the beginning of a line. You can type HELP followed by the name
136of a command for information on it. For commands that take multiple
137arguments, you can type ? in the middle of the command for more information,
138and you can also use help with several arguments. E.g. SET has many different
139things you can set, like SET RECEIVE PACKET-LENGTH 1000. You can type 'SET
140?', or 'SET RECEIVE ?', etc. 'HELP SET' talks about the 'SET' command in
141general, 'HELP SET RECEIVE talks about the SET RECEIVE options.
142.SH BACKSLASH NOTATION
143Within an interactive command, \\ is a special character to help you enter
144special quantities, or ordinary characters that would otherwise be illegal or
145hard to type. At the end of a line, \\ (backslash) (or - dash) makes the next
146line a continuation of the current line. Other than that, the character
147following the \\ identifies what the thing is:
148.nf
149
150 % A user-defined simple (scalar) variable such as \\%a or \\%1
151 & an array reference such as \\&a[3]
152 $ an environment variable such as \\$(TERM)
153 v (or V) a built-in variable such as \\v(time)
154 f (or F) a function such as \\fSubstring(\\%a,3,2)
155 d (or D) a decimal (base 10) number (1 to 3 digits, 0..255) such as \\d27
156 o (or O) an octal (base 8) number (1 to 3 digits, 0..377) such as \\o33
157 x (or X) a hexadecimal (base 16) number (2 digits, 00..ff) like \\x1b
158 \\ the backslash character itself
159 b (or B) the BREAK signal (OUTPUT command only)
160 l (or L) a Long BREAK signal (OUTPUT only)
161 a decimal digit (a 1-3 digit decimal number) such as \\27
162 anything else: following character taken literally.
163
164.fi
165Note that numbers turn into the character with that binary code, so
166you can use \\7 for a bell, \\13 for carriage return, \\10 for linefeed.
167
168.SH COMMANDS
169.PP
170You can use upper- or lower case for commands. Either one will work (but
171remember that UNIX filenames are case-sensitive). Also, you can abbreviate
172commands as long as the abbreviation matches only one possibility. This is a
173summary of C-Kermit's commands. For more information on each, see
174.IR "Using C-Kermit" ,
175or type HELP and then the command name.
176.nf
177.in 0
178.ll 80
179.ta 15
180
181; Introduce a full-line or trailing comment (also #).
182! Run a system command or enter system command interpreter.
183ASK Prompt the user, store user's reply in a variable.
184ASKQ Like ASK, but, but doesn't echo (useful for passwords).
185ASSIGN Assign an evaluated string to a variable or macro.
186BYE Terminate and log out a remote Kermit server.
187C Special abbreviation for CONNECT.
188CD Change Working Directory (also, CWD).
189CHECK See if a particular feature is built in.
190CLEAR Clear communication device input buffer.
191CLOSE Close a log or other local file.
192COMMENT Introduce a full-line comment.
193CONNECT Establish a terminal connection to a remote computer.
194DECLARE Declare an array.
195DECREMENT Subtract one (or other number) from a variable.
196DEFINE Define a variable or macro.
197DELETE Delete a file or files.
198DIAL Dial a telephone number.
199DIRECTORY Display a directory listing.
200DISABLE Disallow access to selected features during server operation.
201DO Execute a macro ("DO" can be omitted).
202E-PACKET Send an Error packet.
203ECHO Display text on the screen.
204ELSE Used with IF.
205ENABLE Allow access to selected features during server operation.
206END A command file or macro.
207EXIT Exit from the program, closing all open files and devices.
208FINISH Instruct a remote Kermit server to exit, but not log out.
209FOR Execute commands repeatedly in a counted loop.
210G Special abbreviation for GET.
211GET Get files from a remote Kermit server.
212GETOK Ask question, get Yes or No answer, set SUCCESS or FAILURE.
213GOTO Go to a labeled command in a command file or macro.
214HANGUP Hang up the phone or network connection.
215HELP Display a help message for a given command.
216IF Conditionally execute the following command.
217INCREMENT Add one (or other number) to a variable.
218INPUT Match characters from another computer against a given text.
219INTRO Print a brief introduction to C-Kermit.
220LOG Open a log file -- debugging, packet, session, transaction.
221MAIL Send a file to other Kermit, to be delivered as e-mail.
222MSEND Send a list of files to the other Kermit.
223MSLEEP Sleep for given number of milliseconds.
224OPEN Open a local file for reading or writing.
225O Special abbreviation for OUTPUT.
226OUTPUT Send text to another computer.
227PAD Command for X.25 PAD (SunLink X.25 only)
228PAUSE Do nothing for a given number of seconds.
229PING Check status of remote TCP/IP host.
230PRINT Print a file on a printer.
231PUSH Invoke host system interactive command interpreter.
232PWD Display current working directory.
233QUIT Same as EXIT.
234R Special abbreviation for RECEIVE.
235READ Read a line from a local file.
236RECEIVE Passively wait for files to arrive.
237REDIAL The the most recently DIALed number again.
238REINPUT Reexamine text previously received from another computer.
239REMOTE Issue file management commands to a remote Kermit server.
240RENAME Change the name of a file.
241RETURN Return from a user-defined function.
242RUN Run a program or system command.
243S Special abbreviation for SEND.
244SCRIPT Execute a UUCP-style login script.
245SEND Send files.
246SERVER Begin server operation.
247SET Set various parameters.
248SHOW Display values of SET parameters.
249SLEEP Sleep for given number of seconds.
250SPACE Display current disk space usage.
251STATISTICS Display statistics about most recent file transfer.
252STOP Stop executing macro or command file, return to prompt.
253SUSPEND Suspend Kermit (use only if shell supports job control!).
254TAKE Execute commands from a file.
255TELNET Make a TCP/IP TELNET connection to a remote network host.
256TRANLATE Translate a file's character set.
257TRANSMIT Upload a file with no error checking.
258TYPE Display a file on the screen.
259VERSION Display the program version number on the screen.
260WAIT Wait for the specified modem signals.
261WHILE Execute commands repeatedly while a condition is true.
262WRITE Write text to a local file.
263XIF Extended IF command.
264XLATE Synonym for TRANSLATE.
265XMIT Synonym for TRANSMIT.
266.ll
267.in
268.fi
269.SH PARAMETERS YOU CAN SET
270Here are some of the parameters you can change with the SET command. Note
271that many of them require further specification, e.g. there are several
272RECEIVE parameters. So commands using SET RECEIVE
273look like "SET RECEIVE PACKET-LENGTH 1000". For parameters like that,
274the possible second words are listed below them.
275.nf
276.in 0
277.ll 80
278.ta 15
279
280ATTRIBUTES Turn Attribute packet processing on or off.
281 BLOCKSIZE, CHARACTER-SET, DATE, DISPOSITION,
282 LENGTH, OS-SPECIFIC, SYSTEM-ID, ALL
283BLOCK-CHECK Level of file transfer error detection.
284BUFFERS Size of send and receive packet buffers.
285CARRIER Treatment of carrier on terminal connections.
286CASE Treatment of alphabetic case in string comparisons.
287COMMAND BYTESIZE used between C-Kermit and your keyboard and screen.
288COUNT For counted loops.
289DEBUG Log or display debugging information.
290DELAY How long to wait before sending first packet.
291DIAL Parameters related to dialing.
292 DIAL-COMMAND, DIRECTORY, DISPLAY, HANGUP, INIT-STRING,
293 KERMIT-SPOOF, MNP-ENABLE, SPEED-MATCHING, TIMEOUT
294DUPLEX Specify which side echoes during CONNECT.
295ESCAPE Prefix for "escape commands" during CONNECT.
296FILE Set transfer file parameters:
297 BYTESIZE, CHARACTER-SET, COLLISION, DISPLAY,
298 INCOMPLETE, NAMES, TYPE
299FLOW-CONTROL Communication line full-duplex flow control.
300HANDSHAKE Communication line half-duplex turnaround character.
301HOST Specify network host name.
302INPUT Control behavior of INPUT command.
303KEY Key mapping and macros for use in CONNECT mode.
304LANGUAGE Enable language-specific character-set translations.
305LINE Serial communication device name.
306MACRO Control aspects of macro execution.
307MODEM-DIALER Type of modem-dialer on communication line.
308NETWORK Network type, e.g. TCP/IP, X.25.
309PAD X.25 X.3 PAD parameters (SunLink X.25 only).
310PARITY Communication line character parity.
311PROMPT The C-Kermit program's interactive command prompt.
312RECEIVE Parameters for inbound packets.
313 END-OF-PACKET, PACKET-LENGTH, PAD-CHARACTER, PADDING
314 START-OF-PACKET, TIMEOUT
315RETRY Packet retransmission limit.
316SEND Parameters for outbound packets.
317 See RECEIVE for subparameters. Normally you set only
318 RECEIVE parameters. SEND parameters come automatically
319 from the Kermit on the other end.
320SERVER Parameters for server operation.
321 TIMEOUT
322SESSION-LOG File type for session log, text or binary.
323SPEED Communication line speed, e.g. 2400, 9600.
324TAKE Control aspects of TAKE file execution.
325TERMINAL Terminal parameters:
326 BYTESIZE, CHARACTER-SET, CR-DISPLAY, ECHO,
327 LOCKING-SHIFT, NEWLINE-MODE
328TRANSFER File transfer parameters:
329 CHARACTER-SET, LOCKING-SHIFT
330TRANSMIT Control aspects of TRANSMIT command execution:
331 ECHO, EOF, FILL, LINEFEED, LOCKING-SHIFT, PAUSE, PROMPT
332UNKNOWN Specify handling of unknown character sets.
333WINDOW File transfer packet window size.
334X.25 Specify X.25 connection parameters (SunLink X.25 only).
335.in
336.ll
337.SH "MACROS AND VARIABLES"
338C-Kermit allows macros and variables. A macro is a command
339that you define, composed of one or more other C-Kermit commands.
340A typical macro is a list of Kermit commands, separated
341by commas. For example:
342.nf
343
344 define sun set speed 9600, set parity none, set duplex full,-
345 set flow xon/xoff
346
347.fi
348You call a macro by using its name, just like normal commands. You can also
349call them using the DO command. If you have given the DEFINE command above
350(or have it in your .kermrc file), then you can type SUN or DO SUN to execute
351all the commands in the definition.
352.PP
353C-Kermit also lets you define variables. Normal variables look like \\%i,
354where i is a single letter. The alphabetic case doesn't matter. \\%a and
355\\%A are the same. Like macros, they are defined by DEFINE or ASSIGN. All
356values are strings. DEFINE gives a variable a fixed value. ASSIGN computes a
357value and assigns it to the variable. To see the difference, look at
358.nf
359
360 def \\%a Monday
361 def \\%b Today is \\%a
362 assign \\%c Today is \\%a
363 def \\%a Tuesday
364 echo \\%b
365 echo \\%c
366
367.fi
368This will print "Today is Tuesday" then "Today is Monday". The difference is
369that when defining \\%c, the \\%a is evaluated at the time of the definition,
370whereas when defining \\%b, the variable name \\%a itself is put in the
371definition. It isn't evaluated until the echo \\%b.
372.PP
373There are also arrays, which use \\& instead of \\%. They are declared by
374DECLARE, e.g. DECLARE \\&A[100]. Elements are referenced with subscripts,
375which may themselves be variables, and act like simple variables, e.g.
376.nf
377
378 DEFINE \\&A[3] Tuesday
379
380.fi
381You can destroy the array by making it zero size, DECLARE \\&A[0].
382The first element of an array is [1].
383.PP
384Macros have normal names. No \\. You call them by using the name like a
385command. If you put additional words on the same line as the macro
386invocation, they become arguments. Inside the macro, you can refer to the
387arguments as \\%1, \\%2, etc. For example:
388.nf
389
390 C-Kermit>define bsend set file type binary, send \\%1
391 C-Kermit>define tsend set file type text, send \\%1
392 C-Kermit>bsend kermit
393 C-Kermit>tsend kermit.doc
394
395.fi
396The number of arguments supplied can be referred to as \\v(argc). If you call
397another macro from a macro, the new one gets its own set of arguments, which
398do not interfere with the previous set.
399.PP
400There are a number of built-in variables, which are referred to by \\v(name).
401They cannot be changed. Type SHOW VARIABLES for a complete list.
402.nf
403
404 \\v(argc) number of arguments in current macro
405 \\v(args) number of program command-line arguments
406 \\v(cmdfile) name of current command file, if any
407 \\v(cmdlevel) current command level
408 \\v(cmdsource) where command are currently coming from, macro, file, etc.
409 \\v(count) current COUNT value
410 \\v(cpu) CPU type C-Kermit was built for
411 \\v(date) date as 8 Feb 1992
412 \\v(day) day of week
413 \\v(directory) current/default directory
414 \\v(exitstatus)current EXIT status (0 = good, nonzero = something failed)
415 \\v(filespec) filespec given in most recent SEND/RECEIVE/GET command
416 \\v(fsize) size of file most recently transferred
417 \\v(home) home directory
418 \\v(host) computer host name
419 \\v(input) current INPUT buffer contents
420 \\v(inchar) character most recently INPUT
421 \\v(incount) how many characters arrived during last INPUT
422 \\v(line) current communications device, set by LINE or HOST
423 \\v(local) 0 if in remote mode, 1 if in local mode
424 \\v(macro) name of currently executing macro, if any
425 \\v(ndate) Current date as 19920208 (yyyymmdd)
426 \\v(ntime) Current local time in seconds since midnight
427 \\v(platform) Specific machine and/or operating system
428 \\v(program) Name of this program ("C-Kermit")
429 \\v(return) Most recent RETURN value
430 \\v(speed) Current speed, if known, or "unknown"
431 \\v(status) 0 or 1 (SUCCESS or FAILURE of previous command)
432 \\v(system) UNIX
433 \\v(time) time as 13:45:23 (hh:mm:ss)
434 \\v(ttyfd) file descriptor of current communication device
435 \\v(version) numeric version of Kermit
436.fi
437.PP
438There are builtin functions, invoked as \\Fname(args). Type SHOW FUNCTIONS for
439a complete list.
440.nf
441
442 \\Fcharacter(arg) convert numeric arg to character
443 \\Fcode(char) numeric code for character
444 \\Fcontents(v) return current definition of variable
445 \\Fdefinition(m) return current definition of macro
446 \\Feval(expr) evaluate arithmetic expression
447 \\Fexecute(m a) execute macro "m" with parameters "a"
448 \\Ffiles(f) number of files matching file spec
449 \\Findex(a1,a2,a3) position of string a2 in a1, starting at pos a3
450 \\Flength(arg) length of the string "arg"
451 \\Fliteral(arg) copy argument literally, no evaluation
452 \\Flower(arg) convert to lower case
453 \\Flpad(text,n,c) left pad text to length n with char c
454 \\Fmax(a1,a2) max of two numbers
455 \\Fmin(a1,a2) min of two numbers
456 \\Fnextfile() next file name from list in last \\Ffiles
457 \\Frepeat(a1,a2) repeat a1 a2 times
458 \\Freverse(arg) reverse character in arg
459 \\Fright(a1,a2) rightmost a2 characters of string a1
460 \\Frpad(text,n,c) right pad text to length n with char c
461 \\Fsubstr(a1,a2,a3) substring of a1, starts at a2, length a3
462 \\Fupper(arg) convert to upper case
463
464.fi
465Eval allows the following operators in the expression. The expression
466can contain variables. Precedences are shown as numbers, 1 is highest
467precedence, 6 is lowest.
468.in +.2i
469.nf
470.ta \w'n @ n 'u +\w'5 'u
471
472( ) 1 parentheses
473n ! 2 factorial
474~ n 3 logical NOT
475- n 4 negative
476n ^ n 4 power
477n * n 5 times
478n / n 5 division
479n % n 5 modulus
480n & n 5 logical AND
481n + n 6 plus
482n - n 6 minus
483n | n 6 logical OR
484n # n 6 exclusive OR
485n @ n 6 greatest common divisor
486
487.fi
488.SH "OPTIONS AND COMMAND LINE ARGUMENTS"
489.PP
490Typically you run Kermit without any arguments, and use a combination
491of .kermrc and interactive commands. However it is possible to put options on
492the command line. This is normally used for scripts. In this case, Kermit is
493invoked as follows:
494.nf
495.ll 80
496
497 kermit [-x arg [-x arg]...[-yyy]..]]
498
499 -x is an option requiring an argument,
500 -y an option with no argument.
501.ta 15
502
503Actions:
504 -s files send files
505 -s - send files from stdin
506 -r receive files
507 -k receive files to stdout
508 -x enter server mode
509 -f finish remote server
510 -g files get remote files from server (quote wildcards)
511 -a name alternate file name, used with -s, -r, -g
512 -c connect (before file transfer), used with -l and -b
513 -n connect (after file transfer), used with -l and -b
514
515Settings:
516 -l line communication line device
517 -j host network host name
518 -q quiet during file transfer
519 -i binary file transfer
520 -b bps line speed, e.g. 1200
521 -m name modem type
522 -p x parity, x = e,o,m,s, or n
523 -t half duplex, xon handshake
524 -e n receive packet length
525 -v n window size
526 -w write over files
527
528Other:
529 -y name alternate init file name
530 -Y Skip init file
531 -d log debug info to debug.log
532 -S Stay, don't exit, after action
533 -C "cmds" Interactive-mode commands
534
535If no action command is included, enter interactive dialog.
536.ll
537.in
538.fi
539.SH FILES
540$HOME/.kermrc \fIKermit\fR initialization commands
541.PD
542.SH AUTHORS
543Frank da Cruz, Columbia University, with contributions from hundreds of
544other volunteer programmers all over the world; "man page" mostly courtesy of
545Charles Hedrick, Rutgers University.
546.SH SEE ALSO
547.TP
548Frank da Cruz and Christine Gianone
549.IR "Using C-Kermit" ,
550Digital Press, Burlington, MA, USA (1993)
551.TP
552Frank da Cruz,
553.IR "Kermit, A File Transfer Protocol" ,
554Digital Press, Bedford, MA, USA (1987)
555.SH DIAGNOSTICS
556The diagnostics produced by
557.I Kermit
558itself are intended to be self-explanatory. In addition, every command
559returns a SUCCESS or FAILURE status that can be tested by IF FAILURE or
560IF SUCCESS. In addition, the program itself returns an exit status code of
5610 upon successful operation or nonzero if any of various operations failed.
562.SH BUGS
563See recent issues of the Info-Kermit digest (on BITNET/EARN, the Internet, or
564the comp.protocols.kermit newsgroup on Usenet) for discussion, or the files
565ckcker.bwr and ckuker.bwr, for a list of bugs. Report
566bugs via e-mail to Info-Kermit-Request@columbia.edu or KERMIT@CUVMA.BITNET.
567Subscribe to Info-Kermit by sending e-mail to I$KERMIT@CUVMA.BITNET or
568I$KERMIT@CUVMA.CC.COLUMBIA.EDU containing the text "subscribe i$kermit"
569followed by your name.
570.br