Kermit@HP-50g - kermit_manual.txt
1
2 C-KERMIT USER GUIDE
3
4
5 FOR UNIX, VAX/VMS, AND SOME OTHER OPERATING SYSTEMS
6
7
8
9 Version 5A(175)
10
11
12
13
14
15 Christine M. Gianone and Frank da Cruz
16
17 Columbia University Center for Computing Activities
18 612 West 115th Street
19 New York, NY 10025 USA
20
21
22
23
24
25 D*R*A*F*T
26
27 22 November 1991
28
29
30
31
32
33
34
35
36
37
38 Copyright (C) 1985, 1991
39 Trustees of Columbia University in the City of New York
40
41 Permission is granted to any individual or institution to use, copy,
42 or redistribute this document so long as it is not sold for profit, and
43 provided this copyright notice is retained.
44
45 1. C-Kermit
46
47 ********
48 This document is formatted as an ordinary, plain text ASCII disk file. Typeset
49 copies are available in the Kermit User Guide from Columbia University.
50 Changes should be made to CKUKER.MSS.
51 ********
52
53 Program: Frank da Cruz (Columbia University), contributions by many
54 others.
55 Language: C
56 Documentation: Christine Gianone, Frank da Cruz (Columbia University).
57 Version: 5A(175)
58 Date: November 1991
59
60
61 UNIX Kermit Capabilities At A Glance:
62
63 Local operation: Yes
64 Remote operation: Yes
65 Transfer text files: Yes
66 Transfer binary files: Yes
67 International text: Yes
68 Wildcard send: Yes
69 File transfer interruption: Yes
70 Filename collision actions: Yes
71 Can time out: Yes
72 8th-bit prefixing: Yes
73 Repeat count prefixing: Yes
74 Alternate block checks: Yes
75 Automatic parity detection: Yes
76 Dynamic packet length: Yes
77 CONNECT mode: Yes
78 Terminal emulation: Depends on implementation
79 Communication settings: Yes
80 Transmit BREAK: Yes (most versions)
81 Support for dialout modems: Yes
82 TCP/IP support: Yes (BSD UNIX versions, VMS MultiNet)
83 X.25 support: Yes (SUN versions with SunLink)
84 IBM mainframe communication: Yes
85 Transaction logging: Yes
86 Session logging: Yes
87 Debug logging: Yes
88 Packet logging: Yes
89 Act as server: Yes
90 Talk to server: Yes
91 Advanced server functions: Yes
92 Security for server: Yes
93 Local file management: Yes
94 Command/Init files: Yes
95 Long packets: Yes
96 Sliding Windows: Yes
97 File attributes packets: Yes
98 Command macros: Yes
99 Script programming language: Yes
100 Raw file transmit and capture: Yes
101
102 1.1. Acknowledgements
103
104 Thanks to the dozens of people who have been involved in C-Kermit development
105 over the years, especially Bill Catchings and Jeff Damens (formerly of Columbia
106 University), Chris Maio (still of Columbia University), and Herm Fischer of
107 Encino, CA, for their roles in its initial development. And special thanks to
108 those who put so much work into features or testing of version 5A:
109
110 Kristoffer Eriksson (Peridot Konsult AB, Orebro, Sweden)
111 Bo Kullmar (Sveriges Riksbank (Central Bank of Sweden), Stockholm)
112 Tor Lillqvist (Helsinki University, Finland)
113 Warren H. Tucker (Tridom Corporation, Mountain Park, Georgia, USA)
114 Peter Mauzey (AT&T Bell Laboratories, Middletown, New Jersey, USA)
115 Terry Kennedy (St Peters College, Jersey City, NJ, USA)
116 Chuck Hedrick (Rutgers University, New Brunswick, NJ, USA)
117 Joe R. Doupnik (Utah State University, USA)
118 Ken Yap (University of Rochester, New York, USA)
119 Marcello Frutig (Catholic University, Rio de Janeiro, Brazil)
120 Paul Placeway (BBN, Cambridge, Massachusetts, USA)
121 Chris Adie (Edinburgh University, Scotland, UK)
122 Chris Armstrong (Brookhaven National Laboratory, New York, USA)
123 Mark Buda (Digital Equipment Corporation, New Hampshire, USA)
124 William Bader (Software Consulting Services, Nazareth, PA, USA)
125 Steve Walton (California State University Northridge, USA)
126
127 Kristoffer, Bo, Warren, and Peter comprised the "modem committee", which worked
128 long and hard to rationalize C-Kermit's treatment of modem signals in the many
129 and varied Unix environments. Kristoffer and Bo also contributed much code to
130 the Unix-specific support modules. Kristoffer deserves a special Archaeology
131 Achievement Award for a detailed study and unraveling of many years' accretions
132 of incomprehensible "magic" in the infamous ckutio.c module (a collection of
133 supposedly simple functions that give the emphatic lie to all claims that Unix
134 is a "portable operating system").
135
136 Ken got the TCP/IP support started by supplying the sockets code for the
137 Berkeley UNIX version. Marcello supplied the SunLink X.25 code. Paul, as
138 always in recent years, is responsible for the Macintosh end, the two Chris's
139 for the OS/2 version, Terry, William, Mark for the VAX/VMS version, and Steve
140 for the Amiga version.
141
142 Chuck found and fixed many bugs and contributed many valuable insights, as well
143 as writing the Unix "man page" for C-Kermit 5A.
144
145 And thanks to the indefatigable and omniscient Joe Doupnik (author of MS-DOS
146 Kermit), who worked closely with the authors on the design of the sliding
147 window algorithms, the script programming language, and the international
148 character set support during the joint development effort for MS-DOS Kermit 3.0
149 and C-Kermit 5A (and in his spare time, Joe lent a hand with the AT&T 7300 Unix
150 PC version of C-Kermit). And finally, thanks to the dozens (hundreds) of
151 others who tested C-Kermit on dozens (hundreds) of hardware and software
152 platforms and contributed bug reports, fixes, new features, and suggestions:
153 Hirofumi Fujii, Jay Rouman, Andy Fyfe, David MacKenzie, John Chmielewski, Frank
154 Prindle, Dean Long, David A Rasmussen, Ted Medin, Farrell Woods, John Dunlap,
155 Larry Rosenman, Roger Wallace, Jack Bryans, Drew Burton, Daniel Senderowicz,
156 Rich Auletta, Tye McQueen, Evan R Moore, Christian Hemsing, Jeff Altman, Irwin
157 Sobel, Mike Beede, Charlie Epstein, Bob Devonshire, Jim Barbour, Berthold K.P.
158 Horn, Allister J. Gorman, Dave Bruce, Rick Troth, Caleb Strockbine, Charles
159 S. Fuller, Andy Y.A. Kuo, Peter Jones, Lars Kellogg-Stedman, Patrick Wolfe,
160 Dennis Pleticha, John Kesich, Erik Olsen, Mark Zinzow, Tom Wade, Wally
161 Strzelec, Lawrence R. Rogers, Nick Sayer, Piet W Plomp, Manfred Prange, Gary J
162 Rosenblum, Ethan A Lish, Bert Laverman, John Nall, Didier Marion, Nate
163 Williams, Bob Perkins, Brad Robillard, Fred van Kempen, J Roberts, David Dyck,
164 G Brendan Reilly, Matt Sutter, Sergey Kartashoff, Michael Yaroslavtsev, and
165 Konstantin Vinogradov.
166
167
168 1.2. Introduction
169
170 C-Kermit is a communication software program written in C that provides a full
171 implementation of the Kermit file transfer protocol, plus terminal connection,
172 modem dialing, file management, and a powerful script programming language. An
173 important goal of C-Kermit is transportability to different computers and
174 operating systems. To date, C-Kermit (one release or another) has been adapted
175 to UNIX (most versions), VAX/VMS, Data General AOS/VS, IBM OS/2, the Apple
176 Macintosh, the Commodore Amiga, the Atari ST, Apollo Aegis, OS-9, Microsoft
177 Windows, NCR 9800/VE, and others.
178
179 C-Kermit offers you several methods of interaction. On UNIX, VAX/VMS, and
180 other timesharing systems, you have access to Kermit's interactive command
181 parser, and you can also invoke Kermit with command line options. On
182 workstations like the Macintosh, and to some degree the PS/2 with OS/2, there
183 is a mouse-and-window interface with pull-down menus, radio buttons, and so
184 forth; these are (or will be) described in separate documents.
185
186 Interactive operation gives you full access to all of C-Kermit's features.
187 Command-line invocation gives you access to a small but useful subset.
188 Command-line operation is described in Section 1.14.
189
190
191 1.3. Interactive Operation
192
193 C-Kermit's interactive command prompt is "C-Kermit>". In response to this
194 prompt, you can type any valid interactive C-Kermit command. C-Kermit executes
195 the command and then prompts you for another command. The process continues
196 until you instruct the program to terminate.
197
198 Commands begin with a keyword, normally an English verb, such as "send". You
199 may omit trailing characters from any keyword, as long as you specify
200 sufficient characters to distinguish it from any other keyword valid in that
201 field. Certain commonly-used keywords (such as "send", "receive", "connect")
202 also have special non-unique abbreviations ("s" for "send", "r" for "receive",
203 "c" for "connect").
204
205 Command keywords can be entered in either upper or lower case, or any
206 combination. This manual shows command keywords in uppercase for clarity.
207
208 Certain characters have special functions while you are typing interactive
209 commands:
210
211 ? Question mark, typed at any point in a command, will produce a message
212 explaining what is possible or expected at that point. Depending on
213 the context, the message may be a brief phrase, a menu of keywords, or
214 a list of files. Use "?" liberally to feel your way through Kermit's
215 commands.
216
217 ESC (The Escape or Altmode key) -- Request completion of the current
218 keyword or filename, or insertion of a default value. The result will
219 be a beep if the requested operation fails.
220
221 TAB (The horizontal Tab key) -- Same as ESC.
222
223 DEL (The Delete or Rubout key) -- Delete the previous character from the
224 command. You may also use BS (Backspace, Control-H) for this function.
225
226 ^W (Control-W) -- Erase the rightmost word from the command line.
227
228 ^U (Control-U) -- Erase the entire command.
229
230 ^R (Control-R) -- Redisplay the current command.
231
232 ^C (Control-C) -- Interrupt a command.
233
234 SP (Space) -- Delimits fields (keywords, filenames, numbers) within a
235 command.
236
237 CR (Carriage Return) -- Enters the command for execution. LF (Linefeed)
238 or FF (formfeed) may also be used for this purpose.
239
240 \ (Backslash) -- Enter any of the above characters into the command
241 literally. To enter a backslash, type two backslashes in a row (\\).
242 A backslash at the end of a command line causes the next line to be
243 treated as a continuation line; this is useful for readability in
244 command files. Backslash is also used to introduce special characters,
245 variable names, and functions. These are explained in Section 1.11.
246
247 ^Z (Control-Z) -- On systems (like Berkeley Unix, Ultrix) with job
248 control, Control-Z is supposed to suspend Kermit, i.e. put it into the
249 background in such a way that it can be brought back into the
250 foreground (e.g. with an 'fg' shell command) with all its settings
251 intact.
252
253 You may type the editing characters (DEL, ^W, etc) repeatedly, to delete all
254 the way back to the prompt. No action will be performed until the command is
255 entered by typing carriage return, linefeed, or formfeed. If you make any
256 mistakes, you will receive an informative error message and a new prompt --
257 make liberal use of `?' and ESC to feel your way through the commands. One
258 important command is "help" -- you should use it the first time you run
259 C-Kermit.
260
261 Comments may be entered as entire commands, or may appear at the end of any
262 command. Comments are introduced by semicolon (;) or pound sign (#).
263
264 Interactive C-Kermit accepts commands from files as well as from the keyboard.
265 When you start C-Kermit, the program looks for a special file, the Kermit
266 Initialization File in your home or current directory (first it looks in the
267 home directory, then in the current one) and executes any commands it finds
268 there. These commands must be in interactive format, not command-line format.
269 The name of the initialization file is .kermrc in UNIX and CKERMIT.INI in other
270 operating systems.
271
272 Here is a brief list of C-Kermit interactive commands:
273 ; Introduce a full-line or trailing comment (also #).
274 ! Execute a system command or enter system command interpreter.
275 @ Same as !.
276 ASK Prompt the user, store user's reply in a variable.
277 ASKQ Like ASK, but, but doesn't echo (useful for passwords).
278 ASSIGN Assign an evaluated string to a variable or macro.
279 BUG Instructions for reporting bugs.
280 BYE Terminate and log out a remote Kermit server.
281 CD Change Working Directory (also, CWD).
282 CLEAR Clear communication device input buffer.
283 CLOSE Close a log or other local file.
284 COMMENT Introduce a full-line comment.
285 CONNECT Establish a terminal connection to a remote computer.
286 DECLARE Declare an array.
287 DECREMENT Subtract one (or other number) from a variable.
288 DEFINE Define a variable or macro.
289 DELETE Delete a file or files.
290 DIAL Dial a telephone number.
291 DIRECTORY Display a directory listing.
292 DISABLE Disallow access to selected features during server operation.
293 DO Execute a macro.
294 ECHO Display text on the screen.
295 ELSE ELSE-part of an IF command.
296 ENABLE Allow access to selected features during server operation.
297 END A command file or macro.
298 EXIT Exit from the program, closing all open files and devices.
299 FINISH Instruct a remote Kermit server to exit, but not log out.
300 FOR Execute commands repeatedly in a counted loop.
301 GET Get files from a remote Kermit server.
302 GOTO Go to a labeled command in a command file or macro.
303 HANGUP Hang up the phone or network connection.
304 HELP Display a help message for a given command.
305 IF Conditionally execute the following command.
306 INCREMENT Add one (or other number) to a variable.
307 INPUT Match characters from another computer against a given text.
308 LOG Open a log file -- debugging, packet, session, transaction.
309 MAIL Send a file as electronic mail to a specified address.
310 MSEND Multiple SEND -- send a list of files.
311 OPEN Open a local file for reading or writing.
312 OUTPUT Send text to another computer.
313 PAD (X.25 version only) Give X.25 PAD commands.
314 PAUSE Do nothing for a given number of seconds.
315 PUSH Invoke host system interactive command interpreter.
316 PWD Display current working device/directory.
317 QUIT Same as EXIT.
318 READ Read a line from a local file.
319 RECEIVE Passively wait for files to arrive.
320 REDIAL Redial the most recently dialed phone number.
321 REINPUT Reexamine text previously received from another computer.
322 REMOTE Issue file management commands to a remote Kermit server.
323 RENAME Change the name of a file.
324 RETURN Return from a user-defined function.
325 RUN Run a program or system command.
326 SCRIPT Execute a UUCP-style login script.
327 SEND Send files.
328 SERVER Begin server operation.
329 SET Set various parameters.
330 SHOW Display values of SET parameters.
331 SPACE Display current disk space usage.
332 STATISTICS Display statistics about most recent transaction.
333 STOP Stop executing macro or command file and return to the prompt.
334 SUSPEND Put the Kermit program in the backgound.
335 TAKE Execute commands from a file.
336 TRANLATE Translate a file's character set.
337 TRANSMIT Upload a file with no error checking.
338 TYPE Display a file on the screen.
339 VERSION Display the program version number on the screen.
340 WAIT Wait for the specified modem signals.
341 WHILE Execute commands repeatedly while a condition is true.
342 WRITE Write text to a local file.
343 XIF Extended IF command.
344
345 On most computers, C-Kermit can be started simply by typing the word "kermit"
346 (followed by carriage return). If no command-line options are included, Kermit
347 will automatically enter interactive prompting mode. Let's begin by looking at
348 a few of C-Kermit's basic interactive commands. Most important of all when
349 your are just beginning are the commands to exit from the program and to get
350 help about it.
351
352
353 The EXIT and QUIT Commands
354
355 Syntax: EXIT [ number ] Syntax: QUIT [ number ]
356
357 These two commands are identical. Both of them do the following:
358
359 - Hangs up the modem, if the communications line supports data terminal
360 ready.
361 - Relinquish access to any communication line assigned via SET LINE, or
362 any network connection obtained via SET HOST.
363 - Relinquish any uucp and multiuser locks on the communications line
364 (Unix only).
365 - Closes all open logs or other files.
366 - Attempts to insure that the terminal is returned to normal.
367
368 After exit from C-Kermit, your default directory will be the same as when you
369 started the program. The EXIT command is issued implicitly whenever C-Kermit
370 halts normally, e.g. after a command line invocation, or after certain kinds of
371 interruptions.
372
373 C-Kermit returns an exit status of zero, except when an error is encountered,
374 where the exit status is set to a nonzero number, depending on the operating
375 system. In UNIX, the exit status is the sum of 1 (if any SEND commands
376 failed), 2 (if any RECEIVE or GET commands failed), and 4 (if any REMOTE
377 commands failed). If you give a number after the EXIT or QUIT command, that
378 number is returned instead.
379
380
381 The HELP Command
382
383 Syntax: HELP [ { command, { SET, REMOTE } parameter } ]
384
385 Brief help messages or menus are always available at interactive command level
386 by typing a question mark at any point. A slightly more verbose form of help
387 is available through the HELP command. The HELP command with no arguments
388 prints a brief summary of how to enter commands and how to get further help.
389 HELP may be followed by one of the top-level C-Kermit command keywords, such as
390 SEND, to request information about a command. Commands such as SET and REMOTE
391 have a further level of help. Thus you may type HELP, HELP SET, or HELP SET
392 PARITY; each will provide a successively more detailed level of help.
393
394
395 The TAKE Command
396
397 Syntax: TAKE fn1
398
399 The TAKE command instructs C-Kermit to execute commands from the named file.
400 The file may contain any interactive C-Kermit commands, including TAKE; command
401 files may be nested to any reasonable depth, but it may not contain text to be
402 sent to a remote system during the CONNECT command; Use scripts for that (see
403 sections 1.12 and 1.13).
404
405 Echoing of commands from TAKE files and handling of errors during TAKE file
406 execution are controlled by the SET TAKE command.
407
408 Comments may be included in take-command files. Whole-line comments may begin
409 with the word COMMENT. Both trailing and whole-line comments can be introduced
410 using semicolon or pound sign, for example:
411
412 COMMENT - Commands to dial out out using a Hayes modem...
413 set modem hayes ; Specify the kind of modem
414 set line /dev/ttyh8 ; Select a terminal device
415 set speed 19200 ; Set the speed
416 dial 7654321 ; Dial the number
417
418 TAKE-command files are in exactly the same syntax as interactive commands. If
419 you want to include special characters like question mark or backslash that you
420 would have to quote with backslash when typing interactive commands, you must
421 quote these characters the same way in command files. Long lines may be
422 continued by ending them with a single backslash or a dash:
423
424 set\
425 modem\
426 hayes
427 set-
428 line /dev-
429 /ttyh8
430
431 Continued lines cannot have trailing comments. If you put a trailing comment
432 after the dash, then Kermit will not treat the line as continued. If you put a
433 dash at the end of a trailing comment, then Kermit will treat the next line as
434 a continuation of the comment.
435
436 An implicit TAKE command is executed upon your C-Kermit initialization file
437 (.kermrc in UNIX, CKERMIT.INI elsewhere) when C-Kermit starts up, upon either
438 interactive or command-line invocation. The initialization file may contain
439 SET or other commands you want to be in effect at all times. For instance, you
440 might want override the default action when incoming files have the same names
441 as existing files -- in that case, put a command like:
442
443 set file collision overwrite
444
445 Under Unix, you may also use the shell's redirection mechanism to cause
446 C-Kermit to execute commands from a file:
447
448 kermit < cmdfile
449
450 or you can even pipe commands in from another process:
451
452 command | kermit
453
454
455 1.4. Establishing the Connection
456
457 In order to talk about a connection between two computers, we a way to
458 distinguish between them. The local computer is the one that you are using
459 most directly -- a PC or workstation on your desk, or a timesharing computer
460 that you are using from a terminal. Kermit lets you make a connection from the
461 local computer to a remote computer, for example by dialing it up with a modem.
462 The Kermit program on your local computer is said to be in "local mode" and the
463 Kermit program on the remote computer is in "remote mode".
464
465 C-Kermit can be used in either remote or local mode. If you are using C-Kermit
466 in remote mode, you can skip ahead to Section 1.5, File Transfer.
467
468 If you are using C-Kermit in local mode, you must have one of three kinds of
469 connections to the remote computer:
470
471 1. A hardwired asynchronous serial connection, either directly to the
472 other computer, or through some kind of terminal server or switching
473 device.
474
475 2. A dialup connection, which you establish by dialing with a modem.
476
477 3. A network connection.
478
479 To prepare C-Kermit for these connections, several preliminary steps are
480 necessary using the SET command, which is described in Section 1.10, below:
481
482 1. Direct connection: SET LINE device-name, SET SPEED bits-per-second.
483
484 2. Dialup connection, which you establish by dialing with a modem: SET
485 MODEM modem-type, SET LINE device-name, SET SPEED bits-per-second,
486 DIAL phone-number.
487
488 3. Network connection: SET HOST network-host-name. If your version of
489 C-Kermit supports more than one type of network, give the
490 appropriate SET NETWORK command before the SET HOST command.
491
492 In addition, you must establish whatever other communication related settings
493 are appropriate for the connection, including PARITY, DUPLEX, FLOW, and
494 HANDSHAKE. Having done all this, you can use the CONNECT command to begin a
495 terminal session with the remote computer, and once connected, you can initiate
496 file transfers.
497 The CONNECT Command
498
499 The CONNECT command (C is a special abbreviation for CONNECT) links your
500 terminal to another computer as if it were a local terminal to that computer,
501 through the device specified in the most recent SET LINE or SET HOST command,
502 or through the default device if your system is a PC or workstation. All
503 characters you type at your keyboard are sent out the communication line (and
504 if you have SET DUPLEX HALF, also displayed on your screen), and all characters
505 arriving at the communication port are displayed on the screen. Current
506 settings of speed, parity, duplex, and flow-control are honored, and the data
507 connection is 7 bits wide unless you have given the command SET TERMINAL
508 BYTESIZE 8. If you have issued a LOG SESSION command, everything you see on
509 your screen will also be recorded to your session log. This provides a way to
510 "capture" files from remote systems that don't have Kermit programs available.
511
512 To get back to your own system, you must type the "escape character", which is
513 Control-Backslash (^\) unless you have changed it with the SET ESCAPE command,
514 followed by a single-character command, such as C for "close connection".
515 Single-character commands may be entered in upper or lower case. They include:
516
517 C Return to C-Kermit. If you gave an interactive CONNECT command, return
518 to the C-Kermit prompt. If you gave a -c or -n option on the command
519 line, close the connection and return to the system prompt.
520 B Send a BREAK signal.
521 0 (zero) send a null.
522 S Give a status report about the connection.
523 H Hangup the phone.
524 ! Escape to the system command processor "under" Kermit. Exit or logout
525 to return to your CONNECT session.
526 Z Suspend Kermit (UNIX only).
527 \nnn A character in backslash-code form.
528 ^\ Send Control-Backslash itself (whatever you have defined the escape
529 character to be, typed twice in a row sends one copy of it).
530
531 Uppercase and control equivalents for (most of) these letters are also
532 accepted. A space typed after the escape character is ignored. Any other
533 character will produce a beep.
534
535 The connect command simply displays incoming characters on the screen. It is
536 assumed any screen control sequences sent by the host will be handled by the
537 firmware or emulation software in your terminal or PC(Several C-Kermit
538 implementations include terminal emulators, notably Macintosh and OS/2).
539
540 It is sometimes useful to see exactly what characters the host is transmitting,
541 rather than having your terminal or emulator interpret them for you. If you
542 give the command SET DEBUG SESSION, then during CONNECT, C-Kermit will display
543 control characters using "uparrow" notation, for example ^A for Control-A, ^B
544 for Control-B, etc, ^[ for ESC. 8-bit characters are preceded by a tilde (~)
545 character.
546
547
548 The DIAL and REDIAL Commands
549
550 Syntax: DIAL telephone-number
551 Syntax: REDIAL
552
553 The DIAL command controls dialout modems; you should have already issued a SET
554 MODEM command to identify the type of modem to be used for dialing, and then
555 SET LINE and SET SPEED commands to identify the terminal device to which the
556 modem is connected, plus any desired SET CARRIER and SET DIAL commands to
557 modify the behavior of the DIAL command itself.
558
559 In the DIAL command, you supply the phone number and the Kermit program feeds
560 it to the modem in the appropriate format and then interprets dialer return
561 codes and modem signals to inform you whether the call was completed. These
562 actions are based upon built-in knowledge of the control sequences and
563 responses of each make and model of modem that C-Kermit knows about.
564
565 The telephone-number may contain imbedded modem-dialer commands appropriate to
566 the selected modem type, such as comma for Hayes pause, or `&' for Ventel
567 dialtone-wait and `%' for Ventel pause (consult your modem manual for details).
568
569 The REDIAL command is exactly like the DIAL command, except it uses the phone
570 number you specified in your most recent DIAL command.
571
572 At the time of this writing, support is included for the following modems:
573
574 - AT&T 7300 Internal Modem
575 - AT&T 2212C, 2224B, 2224CEO, and 2296A switched network modems in AT&T
576 mode
577 - AT&T Digital Terminal Data Module (DTDM)
578 - Cermetek Info-Mate 212A
579 - Concord Condor CDS 220
580 - Courier HST
581 - DEC DF03-AC
582 - DEC DF100 Series
583 - DEC DF200 Series
584 - General DataComm 212A/ED
585 - Hayes Smartmodem and compatibles
586 - IBM/Siemens/Rolm 9751 CBX DCM
587 - Microcom AX-9624
588 - Penril
589 - Racal Vadic
590 - Telebit Trailblazer, T1000, T1600, T2500
591 - US Robotics 212A
592 - Ventel
593
594 Support for new modems is added to the program from time to time; you can check
595 the current list by typing SET MODEM ?.
596
597 There are also two "generic" modem types -- DIRECT (i.e. no modem at all, so
598 that no attempt is made to deal with modem signals), and UNKNOWN (which tells
599 C-Kermit to attempt to honor modem signals, but leaves the dialing mechanism
600 unspecified). NONE is a synonym for DIRECT.
601
602 The device used for dialing out is the one selected in the most recent SET LINE
603 command (or on a workstation, the default line if no SET LINE command was
604 given). On Unix systems, the DIAL command attempts to lock the terminal
605 device's path and to establish a call on an exclusive basis. If it is desired
606 to dial a call and then return to the shell (such as to do Kermit activities
607 depending on standard in/out redirection), it is necessary to place the dialed
608 call under one device name (say, "/dev/cua0") and then escape to the shell
609 within Kermit on a linked device which is separate from the dialed line (say,
610 "/dev/cul0"). This is the same technique used by uucp (to allow locks to be
611 placed separately for dialing and conversing).
612
613 Because modem dialers have strict requirements to override the carrier-detect
614 signal most Unix implementations expect, the sequence for dialing is more rigid
615 than most other C-Kermit procedures. Example:
616
617 kermit
618 C-Kermit>set modem hayes ; SET MODEM first!
619 C-Kermit>set carrier auto ; Then SET CARRIER if necessary,
620 C-Kermit>set line /dev/acu2 ; Then SET LINE,
621 C-Kermit>set speed 2400 ; Then SET SPEED,
622 C-Kermit>set dial display on ; Then SET DIAL if necessary,
623 C-Kermit>dial 9,5551212 ; and finally, DIAL.
624 Connected! ; If DIAL completes OK,
625 C-Kermit>connect ; you can CONNECT.
626 logon, do things
627 ^\c
628 C-Kermit> ...
629 C-Kermit>quit ; Disconnect & unlock the line.
630
631 In general, C-Kermit requires that the modem provide the "carrier detect" (CD)
632 signal when a call is in progress, and remove that signal when the call
633 completes or the line drops. If a modem switch setting is available to force
634 CD, it should normally not be in that setting. C-Kermit also requires (on most
635 systems) that the modem track the computer's "data terminal ready" (DTR)
636 signal. If a switch setting is available to simulate DTR asserted within the
637 modem, then it should normally not be in that setting. Otherwise the modem
638 will be unable to hang up at the end of a call or when interrupts are received
639 by Kermit.
640
641 If you want to interrupt a DIAL command in progress (for instance, because you
642 just realize that you gave it the wrong number), type a Control-C get back to
643 command level. If you are a UNIX user and your "interrupt character" is
644 defined as something besides Ctrl-C, use that instead.
645
646 PROBLEMS: The DIAL command hangs up the phone (see HANGUP) prior to dialing.
647 Because of the problems described for HANGUP, certain UNIX configurations are
648 unable to use DIAL when it does this. To work around this problem, give the
649 command SET DIAL HANGUP OFF before giving the DIAL command. If DIAL still
650 doesn't work right, start over again but this time give the command SET CARRIER
651 OFF prior to SET LINE.
652
653 See the command summary for a description of SET DIAL options. You can use SET
654 DIAL to modify the modem initialization string, the timeout period for call
655 completion, and so on.
656
657 Hayes and Hayes-compatible, as well as Telebit, modem dialing is supported for
658 both word and digit result codes, and C-Kermit will also attempt to adjust its
659 communication speed in case these modems complete a call at a lower speed than
660 it was placed at (if you have a speed-matching modem, you can defeat this
661 action by giving the command SET DIAL SPEED-MATCHING ON before dialing).
662
663
664 The HANGUP Command
665
666 The HANGUP command attempts to hang up the modem on a local-mode dialout
667 connection established by SET LINE, or to hang up the network connection
668 established by SET HOST, in order to break the connection. On terminal
669 devices, Kermit accomplishes the hangup by momentarily turning off the Data
670 Terminal Ready (DTR) RS-232 signal.
671
672 The means used to drop DTR and bring it back up again are highly dependent on
673 the computer, the version of UNIX, the communication device, the device driver,
674 the modem being used, and even the cable that connects the modem to the
675 communication device. Therefore you might find that this command fails to
676 operate as it should.
677
678 If the HANGUP command fails to hang up a phone connection, then maybe your
679 modem is configured to ignore DTR. You should make sure your modem is
680 configured to pay attention to the computer's DTR signal. Another possibility
681 is that your cable is giving the modem a constant DTR signal, looped back from
682 its own DSR signal; in that case, replace your cable with a regular
683 straight-through modem cable.
684
685 If the HANGUP command does indeed hang up the phone connection, but then you
686 can't communicate with the modem any more to establish a new connection, your
687 version of UNIX may have dropped the DTR signal without bringing it back up
688 again properly. To work around this problem, give the SET LINE command (with
689 no device name) to close the current device, and then another SET LINE command
690 specifying the original device to open it again.
691
692
693 1.5. File Transfer
694
695 Kermit programs can transfer files correctly and completely, using the Kermit
696 file transfer protocol. A Kermit program must be running on both computers.
697 Here is the normal procedure:
698
699 1. Run Kermit on your local computer.
700
701 2. Make the appropriate communication settings (such as modem type,
702 line, speed, parity, etc).
703
704 3. Establish a connection to the remote computer (DIAL if necessary).
705
706 4. CONNECT to the remote computer.
707
708 5. Log in to the remote computer if necessary.
709
710 6. Start Kermit on the remote computer and tell it to send (or receive)
711 a file (or files).
712
713 7. "Escape back" to the local computer.
714
715 8. Tell the local computer to receive (or send) a file (or files).
716
717 When transferring files, C-Kermit converts between upper and lower case
718 filenames and between LF and CRLF line terminators automatically, unless told
719 to do otherwise. When binary files must be transferred, the program should be
720 instructed not to perform LF/CRLF conversion (-i on the command line or SET
721 FILE TYPE BINARY interactively; see below).
722
723 If C-Kermit is in local mode, the screen is continously updated to show the
724 progress of the file transer. A dot is printed for every four data packets,
725 other packets are shown by type:
726
727 I Exchange Parameter Information
728 R Receive Initiation
729 S Send Initiatiation
730 A Attribute Packet
731 F File Header
732 G Generic Server Command
733 C Remote Host Command
734 N Negative Acknowledgement (NAK)
735 E Fatal Error
736 T Indicates a timeout occurred
737 Q Indicates a damaged, undesired, or illegal packet was received
738 % Indicates a packet was retransmitted
739
740 You may type the following interruption commands during file transfer:
741
742 F Interrupt the current File, and go on to the next (if any).
743 X Interrupt the entire Batch of files, terminate the operation.
744 R Resend the current packet.
745 E Error: terminate the current operation immediately and return to prompt.
746 A Display a status report for the current operation.
747
748 EMERGENCY EXIT: When running C-Kermit in remote mode, if you have started a
749 protocol operation (sending or receiving a file, server command wait, etc), you
750 can type two Control-C's directly to the Unix Kermit program ("connect" first
751 if necessary):
752
753 Control-C Control-C
754
755 This will cause the program to display,
756
757 ^C^C...
758
759 and return you to the C-Kermit prompt.
760
761 Before initiating a file transfer, you should be sure that all communication
762 and protocol-related settings are correct. Version 5A of Kermit attempts to
763 make things easier for you in this area in several ways, for example by
764 recognizing file attributes (text or binary, character set, etc) from the other
765 Kermit if it sends them. If your parity is set to NONE, C-Kermit automatically
766 recognizes parity bits on received packets, and adjusts its parity accordingly.
767 But it's better to set these C-Kermit parameters directly yourself to avoid any
768 confusion that might result from these automatic adjustments.
769
770
771 The SEND Command
772
773 Syntax: SEND fn [ rfn1 ]
774
775 Send the file or files denoted by fn to the other Kermit, which should be
776 running as a server, or which should be given the RECEIVE command. The SEND
777 command may be abbreviated to S, even though S is not a unique abbreviation for
778 a top-level C-Kermit command. Each file is sent under its own name (as
779 described above, or as specified by the 'set file names' command). If the
780 second form of the SEND command is used, i.e. with fn1 denoting a single file,
781 rfn1 may be specified as a name to send it under. For example:
782
783 send sows.ear silk.purse
784
785 sends the file sows.ear but tells the other Kermit that its name is silk.purse.
786
787
788 The MSEND Command
789
790 Syntax: MSEND fn [ fn [ fn [ ... ] ] ]
791
792 The MSEND command also sends one or more files, but unlike the SEND command, it
793 allows you to give a list of files to send, and it does not allow you to
794 specify an alternate name. The MSEND file specifications are separated by
795 spaces.
796
797 Both the SEND and MSEND commands allow you to use wildcard (meta) characters to
798 specify groups of files. Exactly which wildcard characters are available
799 depend on the host operating system and other factors. In VAX/VMS, they are
800 `*' and `%'. In UNIX they are `~', `*', and `?'. If `?' is to be included,
801 it must be prefixed by `\' to override its normal function of providing help.
802 The `*' character matches any string, and `?' (UNIX) or `%' (VMS) matches any
803 single character.
804
805 When fn contains `*' or `?' characters, there is a limit to the number of files
806 that can be matched, which varies from system to system. If you get the
807 message "Too many files match" then you'll have to make a more judicious
808 selection. For example, if fn was of the form:
809
810 usr/longname/anotherlongname/*
811
812 then C-Kermit's string space will fill up rapidly -- try using CD to change
813 your directory to the path in question and reissuing the command.
814
815 Wildcards do not descend through a directory tree. Only files in the current
816 or specified directory are sent.
817
818 In UNIX versions of C-Kermit only, `~' is treated as a meta character if it is
819 the first character in the file specification. If it is followed immediately by
820 a slash, a space, or end of line, then your login directory name is
821 substituted. If it is followed immediately by a username, then that user's
822 login directory name is substituted. (In VAX/VMS, you can use logical names in
823 the file specification for the same purpose.)
824
825 Wildcard Notation for UNIX
826
827 Normally, C-Kermit expands wildcard characters itself by searching through the
828 disk and matching names against the pattern you specify. But Kermit's
829 pattern-matching abilities are limited to the metacharacters listed above.
830 UNIX shells like csh and ksh, on the other hand, offer notations for file
831 groups, like `[bcdfhjlns]og' or `*.{txt,doc}' that Kermit cannot handle on its
832 own. Kermit lets you get at these capabilities with the command:
833
834 SET WILDCARD-EXPANSION { KERMIT, SHELL }
835
836 The default is KERMIT, meaning Kermit itself expands wildcards in SEND and
837 MSEND, as well as what it receives while in server mode from GET commands. The
838 SHELL option means Kermit calls upon the user's preferred shell (via the SHELL
839 environment variable, or failing that, the user's login shell via getpwuid) to
840 expand them.
841
842 Advantages of the SHELL method include more flexibility in file selection,
843 consistency with the user's shell, and ability to handle a larger number of
844 files. But there are drawbacks. It's noticably slower. Characters in
845 filenames that are special to the shell (like |, &, `, etc) must be quoted with
846 \ (this is not necessary when Kermit expands). And the same Kermit command
847 (SEND, MSEND, or GET sent to a server) may behave differently depending on what
848 your login shell is. For example, "{aaa,bbb}" is expanded by the csh, but
849 taken literally by sh and ksh; "[a-z]" is expanded by csh and ksh, but taken
850 literally by sh.
851
852 The expansion is done by passing "echo " concatenated with the user's filespec
853 to the shell. This assumes that echo is a built-in shell command, or if it's
854 not, then the echo program is in the user's path (risky). "echo" is used
855 rather than "ls -d" because ls says "xxx not found" if xxx does not exist
856 (unfortunately, the csh version of "echo" says "echo: no match" if you give it
857 a string containing metacharacters and no files match, wherease sh and ksh
858 simply echo the string back at you). It doesn't matter much, because C-Kermit
859 checks each word that is returned for its existence as a file (but of course,
860 you could have a file called "echo:", "no", or "match"...). And then what
861 happens if your have a file called "-n"? ("echo -n" is a command. Refer to a
862 file called "-n" in the current directory as "./-n").
863
864 Text vs Binary Files
865
866 When C-Kermit sends each file, it also sends certain information about the file
867 in an "attribute packet", provided the other Kermit agrees to accept attribute
868 packets. This information includes the size, type (text or binary, determined
869 from the "-i" command-line option or the "set file type" command), creation
870 date, and a code to let the other Kermit know that the file is being sent from
871 a Unix system. The other Kermit may accept or refuse the file based upon these
872 attributes, for example, if it doesn't have enough disk space to store a file
873 of the specified size.
874
875 The file type attribute allows C-Kermit, when sending a file, to tell the
876 receiving whether it should be in text or binary mode. Therefore, if the
877 receiving Kermit has this feature, it is not necessay to give it a SET FILE
878 TYPE command to "match modes" with C-Kermit.
879
880 Note -- C-Kermit sends only from the current or specified directory. It does
881 not traverse directory trees. If the source directory contains subdirectories,
882 they will be skipped. By the same token, C-Kermit does not create directories
883 when receiving files. If you have a need to do this, you can pipe tar through
884 C-Kermit, as shown in the example in section 1.14, or under AT&T System III/V
885 Unix you can use cpio, or BACKUP under VAX/VMS, etc.
886
887 Another Note -- The SEND command skips over "invisible" files that match the
888 file specification; Unix systems usually treat files whose names start with a
889 dot (like .login, .cshrc, and .kermrc) as invisible. If you want to send
890 these, include the dot in your filespec, as in:
891
892 send .*
893 The RECEIVE Command
894
895 Syntax: RECEIVE [fn1]
896
897 Passively wait for files to arrive from the other Kermit, which must be given
898 the SEND command -- the RECEIVE command does not work in conjunction with a
899 server (use GET for that). If fn1 is specified, store the first incoming file
900 under that name. The RECEIVE command may be abbreviated to R.
901
902 Incoming file data is normally decoded and stored according to whether C-Kermit
903 is in text or binary mode. But if the other Kermit sends the file-type
904 attribute, this will override C-Kermit's file-type setting on a per-file basis.
905 Therefore, it is possible for another Kermit program to send C-Kermit a mixture
906 of text and binary files, so long as the type of each file is indicated in the
907 Attribute packet. For text files, C-Kermit will perform character-set
908 translation if a known transfer character set is indicated in the Attribute
909 packet (see section on International Characters).
910
911 C-Kermit also attempts to store the incoming file with the creation date that
912 is specified in the Attribute packet. C-Kermit does not attempt to verify disk
913 space against the announced size of the incoming file.
914
915 You can control C-Kermit's use of these attributes using the SET ATTRIBUTE
916 command.
917
918
919 The STATISTICS Command
920
921 The STATISTICS command displays information about the most recent Kermit file
922 transfer or other protocol transaction, including file and communication line
923 input and output, timing and efficiency, as well as what encoding options were
924 in effect (such as 8th-bit prefixing, repeat-count compression, packet lengths,
925 window size).
926
927
928 Non-Protocol Data Transfers
929
930 It is also possible to transfer files with other computers that do not have a
931 Kermit program available. To send a file to such a computer, use the TRANSMIT
932 command:
933
934 Syntax: TRANSMIT fn1
935
936 This command sends the named file without error checking, obeying current
937 settings for file type (text or binary), parity, and duplex.
938
939 In text mode, send the file a line at a time, with character translations done
940 according to the current file and transfer character sets, using the SET
941 TRANSMIT PROMPT character (linefeed, \10, by default) as a line turnaround
942 character. That is, send a line from the file, wait until the prompt character
943 comes in response, then send the next line, and so on. If zero (0) is
944 specified for the prompt character, then send the whole file without waiting
945 for any response or echo from the host. Don't try this unless you know that
946 the host can successfully process long continuous bursts of input characters.
947 Each line is terminated by a carriage return, just as you would type it at a
948 terminal. Linefeeds are stripped unless you have given the command SET
949 TRANSMIT LINEFEED ON. The computer to which you are transmitting the file
950 should be prepared to receive it, for instance into a text editor.
951
952 In binary mode, send all the characters of the file with no modification and no
953 line turnaround handshake (the TRANSMIT PROMPT setting is ignored). Use binary
954 mode only if you know that the computer or device to which you are transmitting
955 the file can receive arbitrary patterns of characters at full speed.
956
957 If you want to transmit 8-bit data over a 7-bit connection (i.e. PARITY is not
958 NONE), you can use SET TRANSMIT LOCKING-SHIFT ON to have Kermit send SO/SI
959 shifts around your 8-bit characters. The TRANSMIT command can be interrupted
960 by typing Ctrl-C. Also see SET TRANSMIT.
961
962 The opposite of TRANSMIT is LOG SESSION, which lets you capture files or screen
963 data from remote computers during CONNECT, also without error checking.
964
965 XMIT may be used as a synonym for TRANSMIT in the TRANSMIT, SET TRANSMIT, and
966 SHOW TRANSMIT commands.
967
968
969 1.6. Being and Using a Kermit Server
970
971 The SERVER command places C-Kermit in "server mode" on the currently selected
972 communication device or network connection. All further commands must arrive
973 as valid Kermit packets from the Kermit on the other end of the line. If you
974 are running C-Kermit on the remote computer, then you should escape back to
975 your local computer after you give C-Kermit the SERVER command, and then issue
976 all further commands to the C-Kermit server from your local Kermit's command
977 prompt. It is also possible to work the other way: your local computer is the
978 Kermit server and the remote computer issues the commands -- this can only work
979 if the remote Kermit is driven by a TAKE command file (which should end with
980 the command FINISH).
981
982 The C-Kermit server can respond to the following commands from the client:
983
984 Client Command Server Response
985 GET Sends files
986 SEND Receives files
987 MAIL Sends incoming files as e-mail to specified address
988 BYE Attempts to log itself out
989 FINISH Exits to level from which it was invoked
990 REMOTE CD Changes working directory (also, remote cd)
991 REMOTE DIRECTORY Sends directory lising
992 REMOTE DELETE Removes files
993 REMOTE HELP Lists these capabilities
994 REMOTE HOST Executes a Unix shell command
995 REMOTE KERMIT Sends a Kermit command to a Kermit server
996 REMOTE LOGIN Login to a Kermit server that requires this
997 REMOTE LOGOUT Logout from a Kermit server
998 REMOTE PRINT Receives a file and prints it
999 REMOTE SET Changes its settings
1000 REMOTE SPACE Reports about its disk usage
1001 REMOTE TYPE Sends files to your screen
1002 REMOTE WHO Shows who's logged in
1003
1004 If the Kermit server is directed at an external line (i.e. it is in "local
1005 mode") then the console may be used for other work if you SET FILE DISPLAY OFF
1006 and run it in the background; normally the program expects the console to be
1007 used to observe file transfers and enter status queries or to interrupt
1008 commands. The way to get C-Kermit into background operation from interactive
1009 command level varies from system to system (e.g. on Berkeley Unix you would
1010 halt the program with ^Z and then use the C-Shell 'bg' command to continue it
1011 in the background). The more common method is to invoke the program with the
1012 desired command line arguments, including "-q", and with a terminating "&".
1013
1014 The C-Kermit server will accept a list of files in GET commands sent by the
1015 client, similar to the list you can give to the MSEND command, e.g.:
1016
1017 MS-Kermit>get ~joe/new.txt /etc/termcap ../*.c
1018
1019 The file specifications are separated by spaces. If you need to include a
1020 space in a filename, quote it with a backslash, for example:
1021
1022 MS-Kermit>get node"user\ passwd"::dev:[dir]name.ext
1023
1024 If you need to include a backslash, use two of them.
1025
1026 When the Unix Kermit server is given a REMOTE HOST command, it executes it
1027 using the shell invoked upon login, e.g. the Bourne shell, the Korn Shell, or
1028 the Berkeley C-Shell (or whatever the user has set her SHELL environment
1029 variable to be).
1030
1031 The server can issue periodic NAK packets. You can control the rate at which
1032 this happens via SET SERVER TIMEOUT. Specifiying a value of zero instructs
1033 C-Kermit not to do this at all. A nonzero value, n, makes a NAK appear every n
1034 seconds during server command wait. This is useful if the client Kermit is not
1035 capable of timeouts, and a packet that it sends to the server is lost. The
1036 default server timeout is zero.
1037
1038 SECURITY. Before putting C-Kermit into server mode, you can give it commands
1039 to restrict the types of access it allows to clients. The command is DISABLE.
1040 You can turn these accesses back on using the ENABLE command. Here are the
1041 items that can be controlled in this way, with the effect of DISABLE noted.
1042 CAUTION: If you leave HOST enabled, the client can get around some of these
1043 restrictions with REMOTE HOST commands.
1044
1045 BYE Ignore BYE commands from the client, stay in server mode.
1046 CD Don't let the client change directories, or send files to, or
1047 get files from, or delete or type files in, any but the current
1048 directory, nor inquire about space in any but the current
1049 directory.
1050 DELETE Don't let the client delete any files.
1051 DIRECTORY Don't let the client request a directory listing.
1052 FINISH Ignore FINISH commands from the client, stay in server mode.
1053 GET Don't let the client GET files.
1054 HOST Ignore REMOTE HOST commands from the client.
1055 SEND Don't accept files that the client tries to send.
1056 SET Refuse REMOTE SET commands from the client.
1057 SPACE Refuse REMOTE SPACE commands from the client.
1058 TYPE Refuse REMOTE TYPE commands from the client.
1059 WHO Refuse REMOTE WHO commands from the client.
1060 ALL All of the above.
1061
1062
1063 Using a Kermit Server
1064
1065 C-Kermit may itself request services from a remote Kermit server. To send a
1066 file to a Kermit server, use the SEND command, just as you would to send a file
1067 to a Kermit program that has been given the RECEIVE command. But you cannot
1068 use the RECEIVE command to get a file from a Kermit server, because the RECEIVE
1069 command just waits passively for a file to arrive, but the server has not been
1070 told which file to send. For this, you need the GET command:
1071
1072 Syntax: GET rfn
1073
1074 or: GET
1075 rfn
1076 fn1
1077
1078 The GET command requests a remote Kermit server to send the named file or
1079 files, it must be used in place of RECEIVE. Since a remote file specification
1080 (or list) might contain spaces, which normally delimit fields of a C-Kermit
1081 command, an alternate form of the command is provided to allow the inbound file
1082 to be given a new name: type GET alone on a line, and you will be prompted
1083 separately for the remote and local file specifications, for example:
1084
1085 C-Kermit>get
1086 Remote file specification: profile exec
1087 Local name to store it under: profile.exec
1088
1089 If a `?' is to be included in the remote file specification, you must prefix it
1090 with `\' to suppress its normal function of providing help.
1091
1092 If you have started a multiline GET command, you may escape from its lower-
1093 level prompts by typing a carriage return in response to the prompt, e.g.
1094
1095 C-Kermit>get
1096 Remote file specification: foo
1097 Local name to store it under: (Type a carriage return here)
1098 (cancelled)
1099 C-Kermit>
1100
1101 After the GET command has been entered, the file transfer proceeds exactly as
1102 if you had given a SEND command to the other Kermit and a RECEIVE command to
1103 this one.
1104
1105 In addition to SEND and GET, the following commands may also be sent from
1106 C-Kermit to a Kermit server. If the server does not support a command that you
1107 send to it, it will respond with a message like "Unknown server command" or
1108 "Unimplemented REMOTE command".
1109
1110 REMOTE CD [directory]
1111 Request the server to change its default directory (and/or device) to
1112 the one you specify. If none is specified, the server is requested to
1113 return to its primary default directory (normally the login directory).
1114
1115
1116 REMOTE DELETE rfn
1117 The server is requested to delete the specified file or files.
1118
1119
1120 REMOTE DIRECTORY [rfn]
1121 The server is requested to send a directory listing of the specifed
1122 files. If no files are specified, then the server should send a
1123 listing of all the files in the current directory.
1124
1125
1126 REMOTE HELP
1127 The server is requested to send to your screen a list of the commands
1128 that you may issue to it from your local Kermit.
1129
1130
1131 REMOTE HOST command
1132 The server is requested to ask its host operating system to execute the
1133 given command.
1134
1135
1136 REMOTE KERMIT command
1137 The remote server is requested to execute the given command, which is
1138 in its own (Kermit program) syntax.
1139
1140
1141 REMOTE LOGIN userid password [account]
1142 If a remote Kermit server has been set up to require to provide a user
1143 ID and password before you can gain access to it, use this command to
1144 send it the user ID and password.
1145
1146
1147 REMOTE LOGOUT
1148 Remove your access from a remote Kermit server that you have REMOTE
1149 LOGIN'ed to.
1150
1151
1152 REMOTE PRINT file [options]
1153 The file is sent to the server, which is requested via Attribute packet
1154 to print it on its printer using the specified print options.
1155
1156
1157 REMOTE SET parameter value
1158 The server is requested to set the given parameter to the specified
1159 value. Use question mark to find out what parameters and values are
1160 available. The meanings of these parameters and values are explained
1161 in the section on the SET command, below. Perhaps the most useful one
1162 is REMOTE SET FILE TYPE { TEXT, BINARY }.
1163
1164
1165 REMOTE SPACE [dir]
1166 The server is requested to report on available disk space in the
1167 specified device and/or directory, or in the current area if none
1168 specified.
1169
1170
1171 REMOTE TYPE [rfn]
1172 The server is requested to send the specified file for display on your
1173 screen.
1174
1175
1176 REMOTE WHO [user]
1177 The server is requested to send a list of the users who are logged in
1178 on its computer. If a username is given, information about that user
1179 is requested.
1180
1181
1182 BYE and FINISH:
1183 When connected to a remote Kermit server, these commands cause the
1184 remote server to terminate; FINISH returns it to Kermit or system
1185 command level (depending on the implementation or how the program was
1186 invoked); BYE also requests it to log itself out.
1187
1188
1189 1.7. International Character Sets
1190
1191 Text files may be written in languages other than English, and in most cases
1192 that means that they contain non-ASCII characters such as accented letters,
1193 special punctuation marks, etc. Many different character sets have been
1194 devised to represent different languages. These character sets are sometimes
1195 specific to a particular computer manufacturer, and sometimes they conform to
1196 one standard or another. The Kermit file transfer protocol permits Kermit
1197 programs to exchange files written in different character sets by translating
1198 between each computer's local file character set and a standard set that is
1199 used "on the wire". Here are the relevant commands:
1200
1201 SET FILE TYPE TEXT
1202 Character set translation is not done at all unless the file type is
1203 text.
1204
1205
1206 SET TRANSFER CHARACTER-SET name
1207 Tell C-Kermit which character set is to be used on the wire, i.e.
1208 within the Kermit packets. The choices are TRANSPARENT (no
1209 translation, this is the default), ASCII (translate to/from US ASCII),
1210 LATIN1 (ISO 8859-1 Latin Alphabet 1), CYRILLIC-ISO (ISO 8859-5
1211 Latin/Cyrillic Alphabet), and JAPANESE-EUC. Synonym: SET XFER
1212 CHARACTER-SET.
1213
1214
1215 SET FILE CHARACTER-SET name
1216 Tell C-Kermit which character set is used in the local file, ASCII, or
1217 any of a dozen or so 7-bit national replacement character sets (NRCs)
1218 such as ITALIAN, NORWEGIAN, etc, or an 8-bit character set like LATIN1,
1219 DEC-MCS, NEXT (for NeXT workstations), CP437 or CP850 (for IBM or Xenix
1220 systems), APPLE (for A/UX on the Macintosh); CP866, KOI-CYRILLIC,
1221 CYRILLIC-ISO, and SHORT-KOI for Cyrillic; and JAPANESE-EUC, DEC-KANJI,
1222 SHIFT-JIS, and JIS7 for Japanese Kanji.
1223
1224
1225 SET LANGUAGE name
1226 Enable certain language-specific translations, especially for DUTCH,
1227 ICELANDIC, GERMAN, RUSSIAN, and the Scandinavian languages. In
1228 particular, SET LANGUAGE RUSSIAN makes Kermit treat ASCII as if it were
1229 SHORT-KOI when it is a FILE or TRANSFER character set, and the
1230 corresponding TRANSFER or FILE character set is an 8-bit Cyrillic set.
1231
1232
1233 TRANSLATE file1 cs1 cs2 [ file2 ]
1234 Translate the local file file1 from the character set cs1 into the
1235 character set cs2. Both character sets may be selected from C-Kermit's
1236 repertoire of file character sets. The result is stored in file2 or
1237 (if file2 is not specified), displayed on the screen. If LANGUAGE is
1238 set to RUSSIAN, ISO Latin-Cyrillic is used as the intermediate standard
1239 character set during translation, otherwise ISO Latin Alphabet 1 is
1240 used. Does not yet work for Kanji.
1241
1242 The SET commands are described in more detail later.
1243
1244 When sending a file, C-Kermit translates the file from the specified file
1245 character set into the specified transfer character set, and an identifier for
1246 the selected transfer character set is included in the file attribute packet,
1247 if use of attribute packets has been negotiated and a SET ATTR [CHARACTER-SET]
1248 OFF command has not been given.
1249
1250 When receiving, C-Kermit translates from the specified transfer character set
1251 to the specified file character set or, if a transfer character set is
1252 identified in the incoming attribute packet it is used instead. If the file
1253 character set is ASCII and special characters are being received, then they are
1254 translated by stripping diacritical marks and aiming for the closest possible
1255 1-to-1 translation on a per-character basis. But if a SET LANGUAGE command has
1256 been given, special translations can be done. For example if LANGUAGE has been
1257 set to GERMAN and the local file character set is ASCII, and a file arrives
1258 with a transfer character set of LATIN1, then C-Kermit will translate German
1259 umlaut-vowels into the corresponding vowels followed by the letter e, and
1260 German double-s into two s's. Similar translations take effect for other
1261 languages.
1262
1263 If unwanted effects appear because of Kermit's translation, you can disable
1264 this feature with SET ATTRIBUTE CHARACTER-SET OFF.
1265
1266 When transferring text that contains long runs of 8-bit data over a 7-bit
1267 communication channel, efficiency can be improved with the following command:
1268
1269 SET TRANSFER LOCKING-SHIFT { OFF, ON, FORCED }
1270 Specifies whether locking shifts should be used by Kermit when encoding
1271 and decoding packets. A locking shift is a special character, Ctrl-N
1272 (Shift-Out, SO), that means that all the following characters, up to
1273 the next Ctrl-O (Shift-In, SI), are to have their 8th bits set to 1
1274 upon receipt. For long runs of 8-bit characters, this is more
1275 efficient than Kermit's regular "single shift" method of prefixing each
1276 8-bit character by an &-sign. Synonym: SET XFER LOCKING-SHIFT. The
1277 options are:
1278
1279 ON This is the default setting. If PARITY is not NONE, try to
1280 negotiate the use of locking shift protocol with the other Kermit,
1281 and use it if the other Kermit agrees. If PARITY is NONE, locking
1282 shifts won't be used.
1283
1284
1285 OFF Don't use locking shifts.
1286
1287
1288 FORCED
1289 Use locking shifts, regardless of the parity setting and
1290 negotiations. Automatically disables the use of 8th-bit prefixing
1291 (single shifts). For the file sender, this command lets data be
1292 sent to the receiver with embedded SO and SI characters, which can
1293 be processed properly by many terminals, printers, and other
1294 devices. For the file receiver, this command forces the treatment
1295 of SO and SI characters in the data as shift commands.
1296
1297 Locking shifts are most effective for text written in non-Roman alphabets and
1298 encoded in standard 8-bit character sets like ISO Latin/Cyrillic, ISO
1299 Latin/Arabic, ISO Latin/Hebrew, ISO Latin/Greek, or Japanese EUC.
1300 Locking-shift status is displayed by the SHOW and STATISTICS commands.
1301
1302
1303 1.8. Logging Things
1304
1305 Kermit's actions during terminal connection and file transfer can be logged in
1306 several ways, using the LOG command:
1307
1308 Syntax: LOG {DEBUGGING, PACKETS, SESSION, TRANSACTIONS} [ fn1 [ { APPEND, NEW
1309 }=NEW ] ]
1310
1311 C-Kermit's progress may be logged in various ways. The LOG command opens a
1312 log, the CLOSE command closes it. In addition, all open logs are closed by the
1313 EXIT and QUIT commands. A name may be specified for a log file; if the name is
1314 omitted, the file is created with a default name as shown below. If the
1315 keyword APPEND is included at the end of the command, then if the specified
1316 file exists, it is appended to rather than written over; if it does not exist,
1317 a new file is created.
1318
1319 LOG DEBUGGING
1320 This produces a voluminous log of the internal workings of C-Kermit, of use
1321 to Kermit developers or maintainers in tracking down suspected bugs in the
1322 C-Kermit program. Use of this feature slows down the Kermit protocol and
1323 fills up your disk. Default name: debug.log.
1324
1325
1326 LOG PACKETS
1327 This produces a record of all the packets that go in and out of the
1328 communication port. This log is of use to Kermit maintainers who are
1329 tracking down protocol problems in either C-Kermit or any Kermit that
1330 C-Kermit is connected to. Default name: packet.log.
1331
1332
1333 LOG SESSION
1334 This log will contain a copy of everything you see on your screen during
1335 the CONNECT command, except for local messages or interaction with local
1336 escape commands. Default name: session.log.
1337
1338
1339 LOG TRANSACTIONS
1340 The transaction log is a record of all the files that were sent or received
1341 while transaction logging was in effect. It includes time stamps and
1342 statistics, filename transformations, and records of any errors that may
1343 have occurred. The transaction log allows you to have long unattended file
1344 transfer sessions without fear of missing some vital screen message.
1345 Default name: transact.log.
1346
1347 The CLOSE command closes the named log, e.g. CLOSE DEBUG, CLOSE SESSION.
1348
1349 Note: Debug and Transaction logs are a compile-time option; C-Kermit may be
1350 compiled without these logs, in which case it will run faster, it will take up
1351 less space on the disk, but the commands relating to them will not be present.
1352
1353
1354 1.9. Local File Management
1355
1356 C-Kermit allows the following local file management functions from its
1357 interactive command level:
1358
1359 CD [directory-name]
1360 Changes Kermit's working device and/or directory to the one given, or to
1361 the user's default directory and/or device if the name is omitted. This
1362 command affects only the Kermit process and any processes it may
1363 subsequently create. You may use CWD and SET DEFAULT as synonyms for CD.
1364
1365 DELETE fn
1366 Deletes (removes, erases) file fn, which may be the name of a single file
1367 or a wildcard specification containing * and/or ? characters. You may use
1368 RM as a synonym for DELETE.
1369
1370 DIRECTORY [fn]
1371 Displays a listing of the files whose names match fn, which may be the name
1372 of a single file or a wildcard specification containing * and/or ?
1373 characters. If no fn is given, C-Kermit lists all files in the current
1374 device and/or directory. The format of and information provided in the
1375 listing depends on the operating system. You may use LS as a synonym for
1376 DIRECTORY.
1377
1378 PWD (Print Working Directory) Display the current working (default) file device
1379 and/or directory. You may use SHOW DEFAULT as a synonym for PWD.
1380
1381 RENAME fn1 fn2
1382 Changes the name of file fn1 to fn2. You may use MV as a synonym for
1383 RENAME.
1384
1385 SPACE
1386 Displays information about disk space and/or quota in the current directory
1387 and device.
1388
1389 TYPE fn
1390 Display the named file on the screen. May be interrupted with Ctrl-C, and
1391 on most systems the display can be stopped and resumed with Ctrl-S and
1392 Ctrl-Q, respectively. You may use CAT as a synonym for TYPE.
1393
1394 { @, !, RUN, PUSH }
1395 The command is executed by your computer's operating system command
1396 interpreter (UNIX shell, VMS DCL, etc). If no command is specified, then
1397 an interactive session is started; exiting from this session, e.g. by
1398 typing Control-D or 'exit' to a UNIX shell, or LOGOUT to VMS DCL, will
1399 return you to C-Kermit command level. Use the `!' command to provide file
1400 management or other functions not explicitly provided by C-Kermit commands.
1401 !, @, RUN, and PUSH are all synonyms for the same command.
1402
1403
1404 1.10. The SET and SHOW Commands
1405
1406 Since Kermit is designed to allow diverse computers to communicate, it is often
1407 necessary to issue special instructions to allow Kermit to adapt to
1408 peculiarities of the other computer or the communication path. These
1409 instructions are accomplished by the SET command. The following parameters may
1410 be SET:
1411 ATTRIBUTES Turn Attribute packet processing on or off.
1412 BACKGROUND Force foreground or background mode.
1413 BLOCK-CHECK Level of packet error detection.
1414 BUFFERS Send and receive packet buffer sizes.
1415 CARRIER Treatment of carrier on terminal connections.
1416 CASE Controls treatment of alphabetic case.
1417 COMMAND Character set size for commands.
1418 COUNT For counted loops.
1419 DEBUG Log or display debugging information.
1420 DEFAULT Default directory.
1421 DELAY How long to wait before sending first packet.
1422 DIAL Parameters for DIAL command.
1423 DUPLEX Specify which side echoes during CONNECT.
1424 ESCAPE Prefix for "escape commands" during CONNECT.
1425 FILE Set various file parameters.
1426 FLOW-CONTROL Communication line full-duplex flow control.
1427 HANDSHAKE Communication line half-duplex turnaround character.
1428 HOST Specify network host name.
1429 INCOMPLETE Disposition for incompletely received files.
1430 INPUT Control behavior of INPUT command.
1431 LANGUAGE Enable language-specific character-set translations.
1432 LINE Communication line device name.
1433 MACRO Control aspects of macro execution.
1434 MODEM-DIALER Type of modem-dialer on communication line.
1435 PAD (X.25 systems only) X.3 PAD parameters.
1436 PARITY Communication line character parity.
1437 PROMPT The C-Kermit program's interactive command prompt.
1438 RECEIVE Parameters for inbound packets.
1439 RETRY Packet retransmission limit.
1440 SEND Parameters for outbound packets.
1441 SERVER Parameters for server operation.
1442 SESSION-LOG (UNIX only) Session log file type, text or binary.
1443 SPEED Communication line speed.
1444 SUSPEND Enable/Disable SUSPEND.
1445 TAKE Control aspects of TAKE file execution.
1446 TERMINAL Terminal parameters.
1447 TRANSFER File transfer parameters.
1448 TRANSMIT Control aspects of TRANSMIT command execution.
1449 UNKNOWN Specify handling of unknown character sets.
1450 WINDOW File transfer packet window size.
1451 WILDCARD (UNIX only) Kermit vs shell wildcard expansion.
1452 X.25 (X.25 systems only) X.25 call parameters
1453
1454 The SHOW command may be used to display current settings. Here is a summary of
1455 settings available in C-Kermit, listed alphabetically.
1456
1457 SET ATTRIBUTES
1458 Tells C-Kermit whether to exchange file attribute (A) packets, or whether
1459 to include specified attributes within the A packets it sends, or whether
1460 to pay attention to specific attributes in A packets it receives. When the
1461 use of A packets has been negotiated, C-Kermit enables and uses the ones
1462 listed below. When sending files, C-Kermit responds to an Attribute
1463 refusal from the other computer by not sending the specified file. For
1464 example, if C-Kermit announces in the A packet that the file is 100K long,
1465 the other Kermit could refuse the file because of insufficient disk space,
1466 and then C-Kermit would not send it.
1467
1468 SET ATTRIBUTE CHARACTER-SET { ON, OFF }
1469 Turn the character-set attribute ON or OFF. If ON, C-Kermit includes a
1470 code for the transfer character set in the A packet when sending a
1471 file, and when receiving a file, C-Kermit will translate from the
1472 character set (if any) specified in the incoming A packet into the
1473 current file character set (see SET FILE), if the transfer character
1474 set is known to C-Kermit (see SET UNKNOWN).
1475
1476
1477 SET ATTRIBUTE DATE { ON, OFF }
1478 If ON, C-Kermit includes the file's creation date in the A packet when
1479 sending a file, and stores incoming files with the creation dates (if
1480 any) given in the incoming A packets. Beware: on some computers,
1481 incremental backups might skip over files with creation dates older
1482 than the most recent backup.
1483
1484
1485 SET ATTRIBUTE DISPOSITION { ON, OFF }
1486 The MAIL and REMOTE PRINT commands work by setting "dispositions" of
1487 Mail and Print in the A packet when sending a file. SET ATTR DISP OFF
1488 will cause C-Kermit to ignore this and store such files on disk rather
1489 than mailing or printing them.
1490
1491
1492 SET ATTRIBUTE LENGTH { ON, OFF }
1493 When sending files, C-Kermit puts their length in the A packet, so the
1494 receiving system has an opportunity to check and/or allocate disk space
1495 in advance, and to refuse the file if there is not enough disk space.
1496 If you believe that files are being unjustly refused on the basis of
1497 length, you can SET ATTR LENGTH OFF. When receiving files, C-Kermit
1498 presently ignores the length announced in the A packet.
1499
1500
1501 SET ATTRIBUTE OS-SPECIFIC { ON, OFF }
1502 Certain versions of Kermit convey operating-system specific file
1503 information in the A packet, which is primarily useful when
1504 transferring files between like systems, such as VMS to VMS. If you
1505 find this feature is interfering with successful file transfer, SET
1506 ATTR OS OFF.
1507
1508
1509 SET ATTRIBUTE SYSTEM-ID { ON, OFF }
1510 The A packet also includes a code identifying the file's operating
1511 system of origin, so that the receiver of the file can decide whether
1512 to pay attention to the OS-SPECIFIC attribute. Use SET ATTR SYS OFF to
1513 disable this feature.
1514
1515
1516 SET ATTRIBUTES ALL { ON, OFF }
1517 You can turn all the above off using SET ATTR ALL OFF, and back on
1518 using SET ATTR ALL ON.
1519
1520
1521 SET ATTRIBUTES { ON, OFF }
1522 This command turns the attribute mechanism itself on or off, without
1523 disturbing the settings of the individual attributes. It is on by
1524 default.
1525
1526
1527
1528 SET BACKGROUND { OFF, ON }
1529 Use SET BACKGROUND off to make your prompts and messages appear in case
1530 they have disappeared because Kermit thinks it is running in the background
1531 (for example, if you are running it through an output filter, as in "kermit
1532 | vt100"). You can accomplish the same effect using the -z option on the
1533 command line.
1534
1535
1536 SET BLOCK-CHECK {1, 2, 3}
1537 Determines the level of per-packet error detection. "1" is a single-
1538 character 6-bit checksum, folded to include the values of all bits from
1539 each character. "2" is a 2-character, 12-bit checksum. "3" is a
1540 3-character, 16-bit cyclic redundancy check (CRC). The higher the block
1541 check, the better the error detection and correction and the higher the
1542 resulting overhead. Type 1 is most commonly used; it is supported by all
1543 Kermit implementations, and it has proven adequate in most circumstances.
1544 Types 2 or 3 should be used when transferring 8-bit data or when using long
1545 packets.
1546
1547
1548 SET BUFFERS n1 n2
1549 Allows you to change the total buffer space used for sending packets (n1)
1550 and receiving packets (n2), if Kermit has been configured to allow dynamic
1551 buffer allocation. The bigger you make them, the longer your packets can
1552 be, and the more window slots you can use. To see the default values for
1553 your version of Kermit, type SHOW PROTOCOL.
1554
1555
1556 SET CARRIER {AUTO, ON [n], OFF}
1557 Specifies C-Kermit's treatment of the Carrier (CD, DCD, or RLSD) RS-232
1558 signal on terminal device connections obtained via SET LINE:
1559
1560 SET CARRIER ON
1561 Means to require carrier at all times; SET LINE will not return until
1562 carrier appears (handy for setting Kermit up to wait for a call to come
1563 in), and a fatal error will occur if carrier disappears during CONNECT
1564 or file transfer. A nice side effect is that when you log out from the
1565 remote computer, you will be put back at C-Kermit prompt level
1566 automatically if the remote system drops carrier properly. If you want
1567 to set a time limit on how long SET LINE will wait for carrier, you can
1568 include an optional number after SET CARRIER ON to specify the number
1569 of seconds to wait before timing out and returning to the prompt, for
1570 example SET CARRIER ON 30.
1571
1572
1573 SET CARRIER OFF means to ignore carrier at all times. Useful for direct,
1574 nonmodem connections, or misbehaving modem connections. Should only be
1575 used when necessary, because it takes away the ability of Kermit to
1576 automatically detect a broken phone connection.
1577
1578
1579 SET CARRIER AUTO means to require carrier during CONNECT but not at other
1580 times. AUTO is the default. SET CARRIER ON does not affect the DIAL
1581 command.
1582
1583
1584
1585 SET CASE { ON, OFF }
1586 Tells C-Kermit whether to pay attention to or ignore alphabetic case in
1587 string matching operations, including INPUT and IF. Default is OFF, i.e.
1588 ignore case.
1589
1590
1591 SET COMMAND BYTESIZE { 7, 8 }
1592 Normally, C-Kermit's command processor strips off the 8th bit of any
1593 character you type, in case your data connection to C-Kermit has parity.
1594 If there is no parity and you want to use an 8-bit international character
1595 set in your commands (for example, in the ECHO command, or in filenames),
1596 use SET COMMAND BYTESIZE 8. The command also applies to the connection
1597 between your terminal (if any) and C-Kermit during terminal emulation
1598 (CONNECT), as opposed to the connection between C-Kermit and the remote
1599 host (see SET TERMINAL BYTESIZE).
1600
1601
1602 SET COUNT n
1603 For use with counted loops. See the section on script language
1604 programming.
1605
1606
1607 SET DEFAULT directory
1608 Change default directory. Equivalent to CD.
1609
1610
1611 SET DIAL DISPLAY { ON, OFF }
1612 Show dialing activity on screen.
1613
1614
1615 SET DIAL HANGUP { ON, OFF }
1616 Normally, the DIAL command will attempt to hang up the phone before dialing
1617 a new call. This is done by momentarily dropping the Data Terminal Ready
1618 (DTR) signal on the currently selected terminal device. Unfortunately, the
1619 method for doing this is ill-defined in some versions of UNIX, and in some
1620 cases DTR goes down and stays down, which can prevent all further
1621 communication between the computer and the modem. If you find that the
1622 DIAL command does not work for you at all, try giving the command SET DIAL
1623 HANGUP OFF before giving the DIAL command. This will prevent DIAL from
1624 hanging up the phone before dialing the new call.
1625
1626
1627 SET DIAL INIT-STRING string
1628 Replace Kermit's built-in initialization string with string, which may
1629 contain backslash codes to represent control characters.
1630
1631
1632 SET DIAL MNP-ENABLE { ON, OFF }
1633 Enable or disable MNP protocol negotiations by the modem. Normally off.
1634 This command presently applies only to Telebit modems.
1635
1636
1637 SET DIAL KERMIT-SPOOF { OFF, ON }
1638 Enable modem's "Kermit spoof" if it has one.
1639
1640
1641 SET DIAL SPEED-MATCHING { OFF, ON }
1642 Tells whether the modem's interface speed is locked. Default is OFF,
1643 meaning the modem changes its interface speed to match the connection
1644 speed, for example if you place a call at 2400 bps and it is answered at
1645 1200 bps. Use ON if your modem is configured to do speed matching.
1646
1647
1648 SET DIAL TIMEOUT number
1649 Seconds to wait for a response from the modem when dialing before giving up
1650 and declaring that the call could not be completed. If you don't give this
1651 command, Kermit calculates its own dial timeout based on the modem type,
1652 length of the phone number, and transmission speed. If that interval isn't
1653 long enough, use this command to specify a longer one.
1654
1655
1656 SET DEBUG { ON, OFF, SESSION }
1657 SET DEBUG ON is equivalent to LOG DEBUG. SET DEBUG SESSION means to
1658 display incoming control and 8-bit characters on the screen using special
1659 notation (see CONNECT). SET DEBUG OFF turns off all debugging.
1660
1661
1662 SET DELAY n
1663 How many seconds to wait before sending the first packet after a SEND
1664 command. Used in remote mode to give you time to escape back to your local
1665 Kermit and issue a RECEIVE command before the first Kermit packet appears.
1666 Normally 5 seconds.
1667
1668
1669 SET DUPLEX {FULL, HALF}
1670 For use during CONNECT. Specifies which side is doing the echoing; FULL
1671 means the other side, HALF means C-Kermit must echo your keystrokes itself.
1672 Normally FULL. Use half when communicating with IBM mainframes over
1673 linemode connections, and on similar half-duplex or local-echo connections.
1674 Synonym: SET LOCAL-ECHO {OFF, ON}.
1675
1676
1677 SET ESCAPE-CHARACTER cc
1678 For use during CONNECT to get C-Kermit's attention. The escape character
1679 acts as a prefix to an escape command, for instance to close the connection
1680 and return to C-Kermit or Unix command level. The normal escape character
1681 is Control-Backslash (ASCII 28). See CONNECT.
1682
1683
1684 SET FILE parameter value
1685 Establish file-related parameters:
1686
1687 SET FILE BYTESIZE { 7, 8 }
1688 Normally 8. If 7, strip the 8th bit from file data during file
1689 transfer.
1690
1691
1692 SET FILE CHARACTER-SET name
1693 tells the encoding of the local file, ASCII by default. The names
1694 DUTCH, GERMAN, FRENCH, etc, refer to 7-bit ASCII-based national
1695 replacement character (NRC) sets. CP866, CYRILLIC-ISO, and
1696 KOI-CYRILLIC refer to sets used in the Soviet Union and other countries
1697 that use the Cyrillic alphabet. Latin-1 is the 8-bit ISO 8859 Latin
1698 Alphabet 1. JAPANESE-EUC, DEC-KANJI, JIS7, and SHIFT-JIS are Japanese
1699 Kanji sets. Type SET FILE CHAR ? for a complete list. When receiving
1700 files, C-Kermit translates from the transfer character set specified in
1701 the most recent SET TRANSFER CHARACTER-SET command or else the one
1702 announced in the Attribute packet (if any) into the file character set.
1703 When sending files, C-Kermit translates from the current file character
1704 set into the current transfer character set.
1705
1706
1707 SET FILE COLLISION action
1708 Tells what to do when a file arrives that has the same name as an
1709 existing file. The actions are:
1710
1711 BACKUP
1712 (default) Rename the old file to a new, unique name and store the
1713 incoming file under the name it arrived with. The "new unique"
1714 name is simply a new generation on VAX/VMS. In UNIX, a "generation
1715 number" appended to the filename, separated by a tilde, as in
1716 oofa.txt.~8~[The new name for the arriving file is of the form
1717 foo.~n~, where foo is the name they share and n is a "generation
1718 number"; if foo exists, then the new file will be called foo.~1~.
1719 If foo and foo.~1~ exist, the new file will be foo.~2~, and so on.
1720 If the new name would be longer than the maximum length for a
1721 filename, then characters are deleted from the end first, for
1722 instance, thelongestname on a system with a limit of 14 characters
1723 would become thelonges.~1~.] WARNING: UNIX C-Kermit presently
1724 offers no method of automatically limiting the number of versions
1725 of a file that can be created, so if too many of them pile up,
1726 you'll have to delete the ones you don't need by hand. Or, because
1727 the version number syntax is compatible with GNU EMACS backup
1728 files, you can use EMACS to do this for you.
1729
1730
1731 OVERWRITE
1732 Overwrite (replace) the existing file. The existing file is gone,
1733 destroyed. Even if the file transfer fails or the incoming file is
1734 refused. Use with caution.
1735
1736
1737 APPEND
1738 Append the incoming file to the end of the existing file. This
1739 option is useful for adding information to a log file, but it
1740 should be used with caution to avoid, for example, joining two
1741 files of different types (like text and binary).
1742
1743
1744 DISCARD
1745 Refuse and/or discard the incoming file. This option is handy for
1746 resuming multi-file transmissions that were broken. Only those
1747 files that were not successfully transferred before will be
1748 accepted.
1749
1750
1751 RENAME
1752 Give the incoming file a unique name, like the BACKUP option,
1753 except that the incoming file gets the new name, rather than the
1754 existing file.
1755
1756
1757 UPDATE
1758 Accept the incoming file only if it is newer than the existing
1759 file. This feature depends on the creation date field in the
1760 attribute packet.
1761
1762
1763
1764 SET FILE DISPLAY { ON, OFF }
1765 Normally ON; when in local mode, display progress of file transfers on
1766 the screen (stdout), and watch the keyboard for interruptions. If OFF
1767 (-q on command line) none of this is done, and the file transfer may
1768 proceed in the background oblivious to any other work concurrently done
1769 at the keyboard.
1770
1771
1772 SET FILE NAMES {CONVERTED, LITERAL}
1773 Normally CONVERTED, which means that outbound filenames have device,
1774 directory, and/or path specifications stripped, lowercase letters
1775 raised to upper, tildes and extra periods changed to X's, and an X
1776 inserted in front of any name that starts with period. In VMS, the
1777 generation number is also stripped. For UNIX only, incoming filenames
1778 have uppercase letters lowered. LITERAL means that none of these
1779 conversions are done; therefore, any directory path appearing in a
1780 received file specification must exist and be write-accessible. When
1781 literal naming is being used, the sender should not use path names in
1782 the file specification unless the same path exists on the target system
1783 and is writable.
1784
1785
1786 SET FILE RECORD-LENGTH n
1787 Tells the record length for fixed-format files, or the maximum record
1788 length for variable-format files, on systems like VAX/VMS where
1789 record-length is a meaningful concept.
1790
1791
1792 SET FILE TYPE {BINARY, TEXT}
1793 The file type is normally text, which means that conversion is done
1794 between the local computer's record format and Kermit's standard
1795 transfer format, for example between Unix newline characters and
1796 Kermit's carriage-return/linefeed sequences. BINARY means to transmit
1797 file contents without conversion. Binary (`-i' in command line
1798 notation) is necessary for binary files, and desirable in all file
1799 transfers between like systems to cut down on overhead.
1800
1801
1802 For VAX/VMS, these are the file type options:
1803
1804
1805 SET FILE TYPE TEXT
1806 Regular Text mode. Applies to incoming files only. When SENDing
1807 files, C-Kermit determines their type automatically.
1808
1809
1810 SET FILE TYPE BINARY [ { FIXED, UNDEFINED } ]
1811 Applies to incoming files only. Binary mode: incoming files are stored
1812 with no translation or conversion. The default record format is FIXED,
1813 but you can specify UNDEFINED too.
1814
1815
1816 SET FILE TYPE IMAGE
1817 This one applies to both incoming and outbound files. For incoming
1818 files, it's just like BINARY FIXED. For outbound files, it means just
1819 send the blocks of the file as they are stored on the disk, and ignore
1820 the file's RMS attributes. SET FILE TYPE BLOCK is a synonym (for
1821 compatibility with Kermit-32).
1822
1823
1824 SET FILE WARNING { ON, OFF }
1825 SET FILE WARNING is an old command, somewhat misnamed. SET FILE
1826 COLLISION (above) should be used instead. SET FILE WARNING ON is
1827 equivalent to SET FILE COLLISION RENAME and SET FILE WARNING OFF is
1828 equivalent to SET FILE COLLISION OVERWRITE.
1829
1830
1831
1832 SET FLOW-CONTROL {DTR/CD, NONE, RTS/CTS, XON/XOFF}
1833 Normally XON/XOFF for full duplex flow control. Should be set to NONE if
1834 the other system cannot do Xon/Xoff flow control, or if you have issued a
1835 SET HANDSHAKE command. If set to XON/XOFF, then HANDSHAKE should be set to
1836 NONE. This setting applies during both terminal connection and file
1837 transfer. Warning: This command may have no effect on certain UNIX
1838 systems, where Kermit puts the communication line into "rawmode" and
1839 rawmode precludes flow control.
1840
1841
1842 The DTR/CD and RTS/CTS options are two kinds of "hardware flow control",
1843 using special wires (other than the data wires) in the connector. These
1844 forms of flow control (especially RTS/CTS) are especially useful with
1845 high-speed modems and similar devices. But these options are only
1846 available in those versions of C-Kermit whose underlying operating system
1847 supports them.
1848
1849
1850 Certain versions of UNIX, such as that on the NeXT, provide RTS/CTS flow
1851 control in a different way, namely in the device driver. For example,
1852 /dev/cua is the first dialout port on the NeXT without RTS/CTS flow
1853 control, and /dev/cufa is the same port, but with built-in RTS/CTS flow
1854 control.
1855
1856
1857
1858
1859 SET HANDSHAKE {XON, XOFF, CR, LF, BELL, ESC, NONE}
1860 Normally NONE. Otherwise, half-duplex communication line turnaround
1861 handshaking is done during file transfer, which means C-Kermit will not
1862 reply to a packet until it has received the indicated handshake character
1863 or has timed out waiting for it; the handshake setting applies only during
1864 file transfer. If you SET HANDSHAKE to other than NONE, then FLOW should
1865 be set to NONE.
1866
1867
1868 SET HOST name
1869 For communicating over a network rather than a terminal device. Presently
1870 supported only for Berkeley-based or other UNIX implementations using the
1871 socket interface to a TCP/IP network, for VAX/VMS with the TGV MultiNet
1872 TCP/IP package, and for SunLink X.25. For TCP/IP networks, the name is the
1873 hostname or IP host number of a host on the network, optionally followed by
1874 a colon and an IP service number. By default, C-Kermit connects to the
1875 telnet (virtual terminal server) socket on TCP/IP connections. For X.25
1876 networks, the name is the X.121 address.
1877
1878
1879 SET INCOMPLETE {DISCARD, KEEP}
1880 Disposition for incompletely received files. If an incoming file is
1881 interrupted or an error occurs during transfer, the part that was received
1882 so far is normally discarded. If you SET INCOMPLETE KEEP then partial
1883 files will be kept.
1884
1885
1886 SET INPUT {CASE, ECHO, TIMEOUT-ACTION}
1887 Controls the behavior of the INPUT command. See the section on script
1888 programming.
1889
1890
1891 SET KEY n1 [ n2 ]
1892 Tell Kermit that when you press the key whose code is n1, it should
1893 substitute the code n2 before (possibly translating, if your TERMINAL
1894 CHARACTER-SET is not TRANSPARENT, and) transmitting to the remote host
1895 during CONNECT mode. The codes n1 and n2 must be numbers between 0 and
1896 255. A key mapping for code n1 applies to all keys produce this code, for
1897 example SET KEY 9 27 assigns the code 27 to the TAB key and to the CTRL-I
1898 key. To find out a key's code, enter the SHOW KEY command, then press the
1899 key. Entering the SET KEY for key n1 without specifying n2 results in
1900 removing any previous key mapping for n1, i.e. n1 sends itself.
1901
1902
1903 SET LANGUAGE {ICELANDIC, GERMAN, NORWEGIAN, RUSSIAN, ...}
1904 For use with international text file transfer. If you tell Kermit what
1905 language a text file is written in, then Kermit might be able to apply
1906 certain transliteration tricks when translating between the file character
1907 set and the transfer character set. See the section on international
1908 character sets.
1909
1910
1911 SET LINE [terminal-device-name]
1912 The device name for the communication line to be used for file transfer and
1913 terminal connection, e.g. /dev/ttyi3 on a Unix system or TXA0: on a VAX/VMS
1914 computer. If you specify a device name, Kermit will be in local mode, and
1915 you should remember to issue any other necessary SET commands, such as SET
1916 SPEED (on Unix, at least, the SET SPEED command is not strictly necessary
1917 -- Kermit will use the line's current speed, but you should use SET SPEED
1918 anyway, so that you be sure that speed you desire is actually being used).
1919
1920
1921 If you omit the device name, Kermit will revert to its default mode of
1922 operation. If you specify the default device name (/dev/tty in Unix, TT:
1923 in VMS), Kermit will enter remote mode (useful when logged in through the
1924 "back port" of a system normally used as a local-mode workstation).
1925
1926
1927 Whenever you give a SET LINE command, C-Kermit closes any currently open
1928 communication device before attempting to open the new one. Therefore SET
1929 LINE is also useful for closing and hanging up a dialed connection.
1930
1931
1932 When Unix Kermit enters local mode, it attempts to synchronize with other
1933 programs (like uucp) that use external communication lines so as to prevent
1934 two programs using the same line at once; before attempting to lock the
1935 specified line, it will close and unlock any external line that was
1936 previously in use. If your system does not allow you to have write access
1937 to the uucp lock directory, then you will receive a message like "Sorry,
1938 access to lock denied." In this case, you must ask your system
1939 administrator to ensure that uucp lockfiles are set up correctly and Kermit
1940 is installed correctly. If Kermit were to use the external line without
1941 proper coordination with uucp (and even other copies of Kermit), then two
1942 or more users could find themselves using the same line at the same time,
1943 which would prevent all useful communication.
1944
1945
1946 If you SET LINE to a communication port that has a modem attached, and you
1947 have SET CARRIER ON, then the SET LINE command will not return until
1948 carrier appears on the device. This is useful for setting up a Kermit
1949 program that other people can dial in to. You can control the amount of
1950 time Kermit will wait for carrier using SET CARRIER ON n, where n is the
1951 number of seconds to wait for a connection before timing out. You can also
1952 interrupt a blocked SET LINE command by typing Ctrl-C.
1953
1954
1955 SET MACRO { ECHO, ERROR } { ON, OFF }
1956 Tells whether the individual commands that comprise a macro should be
1957 echoed on the screen during macro execution (normally they are not), and
1958 whether an error during macro execution should terminate the macro
1959 immediately (normally it does not). See the section on script programming.
1960
1961
1962 SET MODEM-DIALER name
1963 The type of modem dialer on the communication line; the name identifies
1964 the modem type: DIRECT, HAYES, RACALVADIC, VENTEL, etc. "Direct" indicates
1965 either there is no dialout modem, or that if the line requires carrier
1966 detection to open, then SET LINE will hang waiting for an incoming call.
1967 HAYES, VENTEL, and the others indicate that SET LINE will prepare for a
1968 subsequent DIAL command for the given dialer. UNKNOWN means a modem is
1969 attached, but of an unknown or unsupported type. Support for new dialers
1970 is added from time to time, so type SET MODEM ? for a list of those
1971 supported in your copy of Kermit. Also see the description of the DIAL and
1972 SET DIAL commands. NOTE: the SET MODEM command must be given before the
1973 SET LINE command if you plan to use the DIAL command.
1974
1975
1976 SET NETWORK {TCP/IP, X.25}
1977 Select the type of network that is to be used for SET HOST connections.
1978 TCP/IP is presently available for UNIX systems that support the Berkeley
1979 sockets library (such as BSD-based UNIXes, HP-UX, Xenix with Excelan
1980 TCP/IP) and for VAX/VMS with the TGV MultiNet library. X.25 is available
1981 only for SUNs with the SunLink product (see section on X.25 support).
1982
1983
1984 SET PAD
1985 (See X.25 section)
1986
1987
1988 SET PARITY {EVEN, ODD, MARK, SPACE, NONE}
1989 Specify character parity for use in packets and terminal connection,
1990 normally NONE. If other than NONE, C-Kermit will seek to use the 8th-bit
1991 prefixing mechanism for transferring 8-bit data, which can be used
1992 successfully only if the other Kermit agrees during the automatic feature
1993 negotiation phase; if not, 8-bit data cannot be successfully transferred.
1994 In Berkeley-based Unix implementations, if you SET PARITY to other than
1995 NONE, this will also enable Xon/Xoff flow control during file transfer if
1996 FLOW is set to XON/XOFF; otherwise, flow control is not done (because the
1997 communication line must be opened in "raw mode" for 8-bit data, which
1998 precludes the use of Xon/Xoff flow control in Berkeley Unix).
1999
2000
2001 SET PROMPT [text]
2002 The given text will be substituted for "C-Kermit>" as this program's
2003 prompt. If the text is omitted, the prompt will revert to "C-Kermit>". If
2004 the text is enclosed in { curly braces }, the braces are stripped and any
2005 leading and trailing blanks are retained. The text may contain backslash
2006 codes.
2007
2008
2009 SET QUIET {ON, OFF}
2010 Normally OFF. Various informational messages are issued by the user
2011 interface. ON suppresses these messages (but not error messages).
2012 Equivalent to '-q' on the command line.
2013
2014
2015 SET RECEIVE parameter value
2016 (See SET SEND.)
2017
2018
2019 SET RETRY n
2020 Specify the maximum number of times a particular packet can be
2021 retransmitted (because of timeout or transmission errors) before Kermit
2022 gives up and declares the file transfer a failure.
2023
2024
2025 SET {SEND, RECEIVE} parameter value
2026 These commands are used to modify the normal formats and procedures used by
2027 the Kermit file transfer protocol. Normally they are not necessary, but
2028 they can be used to overcome unusual obstacles, or to improve Kermit's
2029 performance.
2030
2031
2032 The SET RECEIVE command lets you tell the other Kermit how it should format
2033 the packets it sends to you. Give SET RECEIVE commands to the Kermit that
2034 is going to receive files. If you plan to transfer files in both
2035 directions, give SET RECEIVE commands to both Kermits.
2036
2037
2038 The SET SEND command rarely needs to be used. It is for overriding what
2039 the the other Kermit requests, and should be necessary only if you cannot
2040 use a SET RECEIVE command to modify the parameter in question on the
2041 receiving Kermit.
2042
2043 SET {RECEIVE, SEND} END-OF-PACKET cc
2044 Specifies the control character that marks the end of a Kermit packet.
2045 Normally 13 (carriage return), which most Kermit implementations
2046 require.
2047
2048
2049 SET {RECEIVE, SEND} PACKET-LENGTH n
2050 Specify the maximum packet length, normally 90. Shorter packet lengths
2051 can be useful on noisy lines, or with systems or front ends or networks
2052 that have small buffers. The shorter the packet, the higher the
2053 overhead, but the lower the chance of a packet being corrupted by
2054 noise, and the less time to retransmit corrupted packets. If you
2055 request a length greater than 94, "long packets" are used, which is a
2056 feature that not all other Kermit programs support (most popular ones
2057 do). C-Kermit can send and receive packets up to about 2000 characters
2058 in length. If you use longer packets, you should also request a
2059 stronger error checking method (see SET BLOCK-CHECK). SET SEND
2060 PACKET-LENGTH overrides the value requested by the other Kermit during
2061 protocol initiation unless the other Kermit requests a shorter length.
2062
2063
2064 SET {RECEIVE, SEND} PAD-CHARACTER cc
2065 SET RECEIVE PAD-CHARACTER allows C-Kermit to request the other Kermit
2066 to use cc as a pad character. Default cc is NUL, ASCII 0. C-Kermit
2067 normally does not need to have incoming packets preceded with pad
2068 characters. SET SEND PAD-CHARACTER designates a character to send
2069 before each packet. Normally, none is sent. Outbound padding is
2070 sometimes necessary for communicating with slow half duplex systems
2071 that provide no other means of line turnaround control. It can also be
2072 used to send special characters to communications equipment that needs
2073 to be put in "transparent" or "no echo" mode, when this can be
2074 accomplished in by feeding it a certain control character.
2075
2076
2077 SET {RECEIVE, SEND} PADDING n
2078 How many pad characters to request or send, normally 0.
2079
2080
2081 SET {RECEIVE, SEND} START-OF-PACKET cc
2082 The normal Kermit packet prefix is Control-A (1); this command changes
2083 the prefix C-Kermit puts on outbound packets. The only reasons this
2084 should ever be changed would be: Some piece of equipment somewhere
2085 between the two Kermit programs will not pass through a Control-A; or,
2086 some piece of of equipment similarly placed is echoing its input. In
2087 the latter case, the recipient of such an echo can change the packet
2088 prefix for outbound packets to be different from that of arriving
2089 packets, so that the echoed packets will be ignored. The opposite
2090 Kermit must also be told to change the prefix for its inbound packets
2091 (use SET RECEIVE START on one Kermit and SET SEND START on the other).
2092
2093
2094 SET {RECEIVE, SEND} TIMEOUT n
2095 Normally, each Kermit partner sets its packet timeout interval based on
2096 what the opposite Kermit requests. SET RECEIVE TIMEOUT allows you to
2097 override the normal procedure and specify a timeout interval for
2098 C-Kermit to use when waiting for packets from the other Kermit. If you
2099 specify 0, then no timeouts will occur, and C-Kermit will wait forever
2100 for expected packets to arrive (relying on the other Kermit to provide
2101 the timeout function). SET SEND TIMEOUT specifies the number of
2102 seconds to wait for a packet before timing it out and retransmitting or
2103 requesting retransmission.
2104
2105
2106
2107 SET SERVER DISPLAY {ON, OFF}
2108 Specify whether C-Kermit, when in server mode, should put a file transfer
2109 display on the screen when it is in local mode. Normally OFF.
2110
2111
2112 SET SERVER TIMEOUT n
2113 Specify the time interval n in seconds for the C-Kermit server to send NAK
2114 packets while waiting for a command packet. These NAKs are intended to
2115 break deadlocks in case a client Kermit that cannot time out sends a
2116 command packet which is lost. However, the server command-wait NAKs can
2117 interfere with originate/answer devices that are to be used for answering.
2118 For example, you can run a C-Kermit server on a modem line that normally
2119 dials out, so that people can dial in to it and give Kermit commands.
2120 While waiting for the phone call to come, the server NAKs might "wake up"
2121 the modem and put it into originate mode, preventing the incoming call from
2122 being answered.
2123
2124
2125 SET SESSION-LOG { BINARY, TEXT }
2126 Specify how the session log is to be written. TEXT is the default, meaning
2127 that lines are written using the convention of the local system; for
2128 example, Unix session logs will have carriage returns (and certain other
2129 extraneous characters like NUL) omitted. BINARY means to record all
2130 characters in the session log.
2131
2132
2133 SET SPEED n
2134 The transmission speed in bits per second ("baud rate") for the
2135 communication line specified in SET LINE (but not SET HOST). This command
2136 cannot be used to change the speed of your own console terminal. Some
2137 computers are set up in such a way that you must give this command after a
2138 SET LINE command before you can use the line. Type SET SPEED ? to see what
2139 speeds are available. Use speeds greater than 9600 with caution, since
2140 they are not necessarily supported by the communication devices on your
2141 computer or the other computer, or the communication path between them.
2142
2143
2144 SET SUSPEND { OFF, ON }
2145 (UNIX only) On UNIX versions that support job control, C-Kermit can
2146 normally be put in the background by typing the suspend character (usually
2147 Ctrl-\), or giving C-Kermit the SUSPEND (or Z) command, or by using the Z
2148 connect-mode escape. SET SUSPEND OFF disables this feature. This is
2149 useful when suspending doesn't work right (e.g. on certain UNIX
2150 implementations that have bugs) or when you are running Kermit under the
2151 Bourne shell.
2152
2153
2154 SET TAKE { ECHO, ERROR } { ON, OFF }
2155 SET TAKE ECHO tells whether commands from a TAKE file are displayed on the
2156 screen as they are executed (normally they are not). SET TAKE ERROR
2157 controls whether execution of a TAKE command file should be terminated if
2158 an error occurs (normally it is not).
2159
2160
2161 SET TERMINAL parameter value
2162 Used for specifying terminal parameters.
2163
2164 SET TERMINAL BYTESIZE { 7, 8 }
2165 tells the character size to be used on the communication line between
2166 the local C-Kermit and the remote Kermit during terminal emulation
2167 (C-Kermit CONNECT command). It's 7 by default, which means that the
2168 high-order (8th) bit is stripped from each incoming and outgoing
2169 character. Use 8 for 8-bit character sets like ISO Latin Alphabet 1,
2170 but this will work only if the connection really is 8-bits no-parity.
2171 Compare with SET COMMAND BYTESIZE.
2172
2173
2174 SET TERMINAL CHARACTER SET <remote-set> [ <local-set> ]
2175 For use during CONNECT. Specify the character set that is being sent
2176 to C-Kermit by the remote computer, and specify which local character
2177 set to translate it into. If the local character set is omitted, the
2178 current file character set is used. The choices for the character sets
2179 are the same as for C-Kermit's file character sets (see SET FILE
2180 CHARACTER-SET). SET TERMINAL CHARACTER-SET TRANSPARENT (which is
2181 Kermit's startup default) means no translation is done. Equivalently,
2182 no translation is done if the local and remote sets are specified to be
2183 the same. When they are different, translation goes through the Latin
2184 Alphabet 1 unless the local character set is Cyrillic-based in which
2185 case it goes through the Latin/Cyrillic Alphabet. Kanji terminal
2186 character-sets are not supported.
2187
2188
2189 SET TERMINAL LOCKING-SHIFT { OFF, ON }
2190 Tells C-Kermit whether to use Shift-In/Shift-Out (Ctrl-O and Ctrl-N) to
2191 switch between 7-bit and 8-bit characters during CONNECT. Applies to
2192 the Kermit-to-remote part of the connection only, and it applies to
2193 both the characters you type and to those Kermit receives from the
2194 remote. OFF by default.
2195
2196
2197 SET TERMINAL NEWLINE { ON, OFF }
2198 OFF is the default. When ON, Kermit sends CRLF whenever you type CR
2199 during terminal emulation.
2200
2201
2202 SET TERMINAL TYPE { VT100, TEK }
2203 (OS/2 C-Kermit only) Select the type of terminal to emulate.
2204
2205 Terminal parameters can be displayed with the SHOW TERMINAL command.
2206
2207
2208 SET TRANSFER CHARACTER-SET name
2209 Tells what character set should be used for file data within Kermit packets
2210 during transfer of text files. The choices are:
2211
2212 TRANSPARENT
2213 Don't translate characters at all.
2214
2215
2216 ASCII
2217 Means to use the 7-bit ASCII (American Standard Code for Information
2218 Interchange) character set. If the local file character set contains
2219 characters that do not occur in ASCII (like accented letters),
2220 represent them in ASCII the best way possible.
2221
2222
2223 CYRILLIC-ISO
2224 Means to use the ISO 8859-5 Latin/Cyrillic Alphabet, which is capable
2225 of representing Russian, Ukrainian, Bulgarian, Serbian, etc.
2226
2227
2228 LATIN1
2229 Means to use ISO 8859 Latin Alphabet 1, which is capable of
2230 representing most western European languages (English, German, Spanish,
2231 Dutch, Italian, Norwegian, Danish, Swedish, Portuguese, etc).
2232
2233
2234 JAPANESE-EUC
2235 Means to use Japanese Extended UNIX Code, which is a mixture of 7-bit
2236 Roman (Japanese ISO 646, similar to ASCII), single-byte Katakana, and
2237 double-byte JIS X 0208 Kanji.
2238
2239
2240
2241 SET TRANSMIT parameter value
2242 Controls the behavior of the TRANSMIT command, used for uploading files to
2243 computers that don't have Kermit programs. See TRANSMIT. The parameters
2244 are:
2245
2246 ECHO { OFF, ON }
2247 Controls whether the characters that are sent to the other computer are
2248 also displayed on your screen. The default is ON.
2249
2250
2251 EOF string
2252 String to send after sending the file, for example SET TRANSMIT EOF \4
2253 to send a Ctrl-D.
2254
2255
2256 FILL character
2257 ASCII value of character to insert into blank lines. Some computers
2258 ignore blank lines, others might terminate the upload when they receive
2259 a blank line. Use this command to insert a character, such as space
2260 (32) or X (88), in any blank line.
2261
2262
2263 LINEFEED { ON, OFF }
2264 Transmit linefeed as well as carriage return at the end of each line.
2265 Normally, only CR is sent.
2266
2267
2268 LOCKING-SHIFT { ON, OFF }
2269 Whether to send the locking-shift characters SO (Ctrl-N) and SI
2270 (Ctrl-O) around 8-bit characters when transmitting and PARITY is not
2271 NONE.
2272
2273
2274 PAUSE n
2275 Number of milliseconds (1000 milliseconds = 1 second) to pause after
2276 sending each line of a text file, or each character of a binary file
2277 (according to SET FILE TYPE). Maximum 1000, default 0.
2278
2279
2280 PROMPT n
2281 ASCII value of character to look for from host before sending next
2282 line, normally LF (10), in text mode only; 0 means not to wait for any
2283 responses from the host -- just send all the characters in a steady
2284 stream. This command has no effect in binary mode (i.e. when FILE TYPE
2285 is set to BINARY).
2286
2287 Synonym: SET XMIT.
2288
2289
2290 SET UNKNOWN-CHAR-SET { DISCARD, KEEP }
2291 Tells what to do if a file arrives whose Attribute packet announces a
2292 transfer character set unknown to C-Kermit.
2293
2294
2295 SET WILDCARD-EXPANSION { KERMIT, SHELL }
2296 (UNIX only) Tells who should expand wildcard characters in SEND and similar
2297 commands: KERMIT (the default) or the user's preferred Unix shell (such as
2298 sh, csh, or ksh).
2299
2300
2301 SET WINDOW n
2302 Select a window size. This refers to Kermit's sliding window packet
2303 transport protocol. Normally, Kermit sends a packet, waits for the reply,
2304 then sends the next packet, and so on. This is called "stop and wait"
2305 operation, corresponding to a window size of 1, and is supported by all
2306 Kermit programs. If you select a window size greater than 1, and if the
2307 other Kermit supports sliding windows, then multiple packets (up to the
2308 window size) can be sent before any replies are required. This allows file
2309 transfer to operate efficiently over connections that have long delays,
2310 like over public data networks or through satellites.
2311
2312
2313 With a sufficiently large window size, transmission can be continuous with
2314 no pauses or delays. The maximum window size is 31, but sizes greater than
2315 5 or 10 are rarely necessary.
2316
2317
2318 Sliding windows may be used in conjunction with long packets, but the
2319 maximum length for packets decreases with increasing window size.
2320
2321
2322 Kermit uses the "selective retransmission" technique, so that if packets
2323 are damaged during sliding windows transfers, only the damaged packets are
2324 retransmitted.
2325
2326
2327 SET X.25
2328 (See X.25 section)
2329
2330
2331 The SHOW Command
2332
2333 Syntax: SHOW category
2334
2335 The SHOW command with the default argument of "parameters" displays the values
2336 of most of the SET parameters described above. If you type a category name
2337 after SHOW, then a more detailed report of parameters within the named category
2338 are displayed, for example SHOW COMMUNICATIONS, SHOW PROTOCOL. Type SHOW ? to
2339 see a list of the available categories.
2340
2341
2342 1.11. Backslash Notation
2343
2344 \ (backslash) in any command means that what follows is not ordinary text, but
2345 rather a code, variable, or function whose value is to be substituted into the
2346 command at that point. The character after the backslash identifies which kind
2347 of quantity this is:
2348
2349 % A user-defined simple (scalar) variable
2350 & an array reference
2351 $ an environment variable
2352 v (or V) a built-in variable
2353 f (or F) a function
2354 d (or D) a decimal (base 10) number
2355 o (or O) an octal (base 8) number
2356 x (or X) a hexadecimal (base 16) number
2357 \ the backslash character itself
2358 b (or B) the BREAK signal (OUTPUT command only)
2359 a decimal digit
2360 a 1-3 digit decimal number.
2361 anything else
2362 The following character is taken literally.
2363
2364 Variables, arrays, functions, etc, are explained in the next section. Numbers
2365 can be expressed in backslash notation in the following ways:
2366
2367 \{...}
2368 A grouped number, braces discarded, e.g. \{17}5 is not the same as \175.
2369
2370
2371 \nnn
2372 (1-3 decimal digits) replaced by binary number 0-255, e.g. \13 represents
2373 carriage return (ASCII 13).
2374
2375
2376 \dnnn or \Dnnn - Same as \nnn
2377
2378
2379 \onnn or \Onnn (1-3 octal digits) replaced by binary number 0-255.
2380
2381
2382 \xnn or \Xnn (2 hexadecimal digits) replaced by binary number 0-255.
2383
2384 Numbers expressed in backslash notation are typically used to express
2385 nonprintable ASCII characters within character strings, or in commands that
2386 want you to enter the ASCII value of a character. Examples:
2387
2388 echo \7Wake up!\7 ; A message with beeps
2389 echo \27[H\27[J ; VT100 clear-screen sequence
2390 set pad-character \o177 ; The ASCII character DEL
2391
2392
2393 1.12. Macros, Variables, and Script Programming
2394
2395 C-Kermit's script programming language is based upon that of MS-DOS Kermit, and
2396 it is in most ways upwards compatible with it, meaning that many MS-DOS Kermit
2397 script programs (or TAKE files in general) will work in C-Kermit with little or
2398 no modification. C-Kermit also has a SCRIPT command that provides a terse but
2399 cryptic shorthand for automating certain kinds of interactive operations (see
2400 Section 1.13).
2401
2402
2403 1.12.1. Variables
2404
2405 A variable name is of the form \%i, where i is a single letter or digit.
2406 Letter-variables are different from digit-variables, which are used as macro
2407 parameters. The alphabetic case of a letter-variable doesn't matter: \%a is
2408 the same variable as \%A.
2409
2410 All variables have character strings as values. A variable is considered to
2411 exist if its value is a string of at least one character in length, otherwise
2412 it is "undefined" and does not exist.
2413
2414 A value is given to a variable using the DEFINE or ASSIGN command:
2415
2416 DEFINE name [ text ]
2417 The named variable (or macro, see below) is created, with text as a value.
2418 If a macro or variable of the given name already exists, its definition is
2419 replaced with the new one. The given text is copied into the definition
2420 literally. If it contains any variable names, functions references, etc,
2421 these are simply copied, rather than evaluated.
2422
2423
2424 ASSIGN name text
2425 The text is evaluated, and then the named variable or macro's value is set
2426 to the evaluated text. This differs from DEFINE, which does not evaluate
2427 the text, but rather copies it literally. The distinction between ASSIGN
2428 and DEFINE doesn't matter unless the text contains variable names. With
2429 ASSIGN, the contents of the variable is copied, whereas with DEFINE, the
2430 name of the variable is copied.
2431
2432 To illustrate the difference between DEFINE and ASSIGN:
2433
2434 def \%a Monday
2435 def \%b Today is \%a
2436 assign \%c Today is \%a
2437 def \%a Tuesday
2438 echo \%b
2439 echo \%c
2440
2441 The definition of \%b is "Today is \%a", so that whenever the value of \%a
2442 changes, so does the value of \%b. The definition of \%c, however, is fixed as
2443 "Today is Monday", because "Monday" was the value of \%a at the time that \%c
2444 was assigned.
2445
2446 A variable can be used in any Kermit command simply by referring to its name:
2447
2448 echo \%a
2449
2450 and variables can be undefined by DEFINEing or ASSIGNing nothing to them, for
2451 example:
2452
2453 define \%a
2454
2455 You can define variables with long names, too:
2456
2457 define telephone-number 7654321
2458
2459 But you have to refer to them in a special way, \m(name), e.g.:
2460
2461 echo \m(telephone-number)
2462
2463 A special kind of variable is called an array. This is simply a list, in which
2464 each element has a number. An array reference looks like \&a[i]. The \& means
2465 this is an array element rather than a simple variable, the letter tells which
2466 array it is (a, b, c, ..., z), and the brackets enclose an index which tells
2467 which member of the array is being referred to: 1, 2, 3, etc. The index can be
2468 a number, or it can be a variable or function (even another array element) that
2469 has a numeric value. Array indices must be (or evaluate to) zero or greater.
2470
2471 Arrays have to be declared before you can use them, so Kermit will know how big
2472 the array is and can create storage for it. The command is DECLARE, for
2473 example:
2474
2475 DECLARE \&A[100]
2476
2477 This tells Kermit to create an array called \&a with 100 elements. Once an
2478 array is declared, its elements can be used just like simple variables:
2479
2480 DEFINE \&A[3] Tuesday
2481
2482 An entire array can be destroyed like this:
2483
2484 DECLARE \&A[0]
2485
2486 If you refer to an element of an array that is not declared, the reference is
2487 replaced by the empty string.
2488
2489 The array \&@[] is predeclared. It contains the command line that the Kermit
2490 program was invoked with, one word per array element. The number of elements
2491 in the array is given in the built-in variable \v(args) (described later).
2492 Example:
2493
2494 $ kermit -p e -b 3
2495
2496 Here \&@[0] is the Kermit program's file specification, like
2497 /usr/local/bin/kermit; \&@[1] is -p, \&@[2] is e, and so on.
2498
2499 The simple variables \%a..\%z and the arrays \&a[]..\&z[] are all global, which
2500 means they can be referenced from anywhere in your script program, including
2501 from within a TAKE file or macro.
2502
2503 You can list the names and values of all existing global simple variables with
2504 the SHOW GLOBALS command, and you can list the names and dimensions of all
2505 declared arrays with SHOW ARRAYS.
2506
2507
2508 1.12.2. Macros
2509
2510 A Kermit macro is a list of one or more Kermit commands that can be referred to
2511 by a single name. Like variables, macros are created by the DEFINE (or ASSIGN)
2512 command:
2513
2514 define ibm set parity mark, set duplex half, set handsh xon
2515
2516 and unlike variables, macros do not have weird-looking names; macro names can
2517 be ordinary words.
2518
2519 Once a macro is defined, you can execute all of its commands simply by typing
2520 the macro's name:
2521
2522 C-Kermit>ibm
2523
2524 If you have defined a macro that has the same name as one of Kermit's built-in
2525 commands, you will have to insert the word DO before the name in order to
2526 execute the macro rather than the built-in command:
2527
2528 C-Kermit>do ibm
2529
2530 (you can also use the word DO to invoke any macro). In these examples, "IBM"
2531 and "DO IBM" are the macro invocations. If you follow a macro invocation by
2532 one or more "words" (a word is a sequence of characters delimited by spaces, or
2533 else at the end of a line), then each of these words is assigned to a
2534 digit-variable that is accessible to the commands within the macro definition.
2535 These trailing "words" are called the macro parameters. The first parameter is
2536 assigned to \%1, the second to \%2, and so on, up to a maximum of nine. The
2537 variable \%0 contains the name of the macro:
2538
2539 define demo echo \%0: \%1 \%2 \%3 \%4 \%5 \%6 \%7 \%8 \%9
2540 demo this is a test of macro argument passing
2541
2542 Variables that do not have corresponding parameters are undefined (empty). The
2543 number of arguments passed to the macro is available in the named variable
2544 \v(argc)(which, for compatibility with MS-DOS Kermit, may also be referred to
2545 simply as ARGC, but only within IF conditions.) Macro parameters are local to
2546 the macro they are passed to. If macro A invokes macro B, macro B gets its own
2547 set of parameters, which are separate from macro A's, so that macro A still has
2548 its own parameters available after macro B has completed. The variables
2549 \%0..\%9 may be used as global variables at "top level", when no macros are
2550 active, by assigning values to them in the normal way. To demonstrate:
2551
2552 define xx echo \%1, yy Sneezy, echo \%1
2553 define yy echo \%1, zz Grumpy, echo \%1
2554 define zz echo \%1
2555 xx Sleepy
2556
2557 Try this, and you'll see how the value of \%1 is saved and restored at each
2558 level.
2559
2560 Macro parameter words may be grouped into single parameters by enclosing them
2561 in braces. Try the following example to see how this works:
2562
2563 define msg echo \%0: \%1
2564 msg this is another test of macro argument passing
2565 msg {this is yet another test of macro argument passing}
2566
2567 You can have a macro list its arguments on your screen by including the command
2568 SHOW ARGUMENTS within the macro definition.
2569
2570 You can list the names and definitions of all existing macros with the SHOW
2571 MACROS command. If you include a name, as in "SHOW MACROS FOO", it will list
2572 the definition(s) of only those macros whose names start with the character(s)
2573 you have specified.
2574
2575 If you define a macro named ON_EXIT, it will be executed automatically when the
2576 Kermit program exits.
2577
2578
2579 1.12.3. Named Variables
2580
2581 Built-in named variables are read-only, you cannot change them. Their names
2582 are of the form \v(name), in which the v can be lower or uppercase, and the
2583 parentheses are required around the variable name. If you refer to a named
2584 variable that does not exist, it will be evaluated as the empty (zero-length)
2585 string. C-Kermit's variables are:
2586
2587 \v(argc)
2588 number of arguments passed to currently active macro.
2589
2590
2591 \v(args)
2592 number of arguments passed to the program on the command line. The
2593 program argument vector is assigned to the array \&@[].
2594
2595
2596 \v(count)
2597 current value of COUNT (loop control via SET COUNT, IF COUNT).
2598
2599
2600 \v(date)
2601 current date in dd mmm yyyy format (e.g. 8 Feb 1990 or 10 Nov 1990)
2602
2603
2604 \v(directory)
2605 current device and/or directory.
2606
2607
2608 \v(filespec)
2609 file specification from most recent SEND, MSEND, or GET command, or the
2610 name of the file most recently received.
2611
2612
2613 \v(home)
2614 user's home (login) directory name.
2615
2616
2617 \v(host)
2618 computer hostname.
2619
2620
2621 \v(input)
2622 current INPUT buffer contents.
2623
2624
2625 \v(line)
2626 current communication device or network host.
2627
2628
2629 \v(ndate)
2630 current date in numeric format, e.g. 19901225.
2631
2632
2633 \v(ntime)
2634 current time in seconds since midnight, 0 through 86399.
2635
2636
2637 \v(platform)
2638 name specific machine or environment C-Kermit was built for.
2639
2640
2641 \v(return)
2642 Value of most recent RETURN command.
2643
2644
2645 \v(speed)
2646 Transmission speed of current communication device, if known. (A
2647 spurious value of 38400 might be reported for pseudoterminals.)
2648
2649
2650 \v(status)
2651 0 if the previous command succeeded, nonzero if it failed.
2652
2653
2654 \v(system)
2655 name of generic operating system C-Kermit was built for, such as UNIX
2656 or VMS.
2657
2658
2659 \v(time)
2660 current time in hh:mm:ss 24-hour clock format (e.g. 13:45:23).
2661
2662
2663 \v(ttyfd)
2664 file descriptor of communication device (UNIX only).
2665
2666
2667 \v(version)
2668 numeric version number of C-Kermit.
2669
2670 You can use these variables in any Kermit command where their values would make
2671 sense:
2672 echo It is \v(time) o'clock on \v(date)
2673
2674 A \v-variable's name can be abbreviated, as long as the abbreviation is enough
2675 to distinguish it from all the other built-in variable names: \v(dir),
2676 \v(ver), etc.
2677
2678 You can get a listing of Kermit's built-in variables and their values with the
2679 SHOW VARIABLES command.
2680
2681
2682 1.12.4. Built-in Functions
2683
2684 Built-in functions are of the form \fname(args). The F and the name can be
2685 upper or lower case. The args are a comma-separated list of arguments. The
2686 function reference is replaced by its value. For example:
2687
2688 define \%a ABC123XYZ
2689 define \%b ...\Flower(\%a)...
2690
2691 results in a value of ...abc123xyz... for \%b.
2692
2693 The names of built-in functions and variables can be abbreviated to their
2694 minimum unique length, for example \feval(1+1), \v(dir), etc. C-Kermit's
2695 functions include string-oriented functions that return a string:
2696
2697 \Fliteral(arg)
2698 Copies its argument literally, without any evaluation.
2699
2700
2701 \Fcharacter(arg)
2702 Returns the single character corresponding to its argument, which must
2703 be numeric. For example, \fchar(65) is 'A', \fchar(193) is A-acute (in
2704 the Latin-1). If you give a negative number or a number larger than
2705 255, only the low-order 8 bits are used.
2706
2707
2708 \Fsubstr(arg1,arg2,arg3)
2709 Substring of the string arg1 starting at position arg2, of length arg3.
2710 arg2 and arg3 must be numbers or variables that have numeric values.
2711 Example:
2712
2713 echo \fsubst(hello there,7,5)
2714
2715 extracts the word "there". The following is equivalent:
2716
2717 define \%a hello there
2718 define \%b 7
2719 define \%c 5
2720 echo \fsubst(\%a,\%b,\%c)
2721
2722
2723
2724 \Flower(arg)
2725 Converts all uppercase letters in its argument to lowercase, for
2726 example:
2727
2728 define \%a FINE
2729 echo This is a \flower(\%a Mess).
2730
2731 prints "This is a fine mess."
2732
2733
2734 \Fupper(arg)
2735 Converts all lowercase letters in its argument to uppercase.
2736
2737
2738 \Freverse(arg)
2739 Reverses the order of the characters in its argument, for example
2740 \frev(mupeen) is neepum.
2741
2742
2743 \Frepeat(arg1,arg2)
2744 Repeats the first argument the number of times given by the second
2745 argument, for example:
2746
2747 echo +\frep(-+,10)
2748
2749 produces +-+-+-+-+-+-+-+-+-+-+.
2750
2751
2752 \Flpad(text,n,c)
2753 Left-pads the text out to length n with character c. If c is omitted,
2754 blank (space) is used.
2755
2756
2757 \Frpad(text,n,c)
2758 Right-pads the text out to length n with character c. If c is omitted,
2759 blank (space) is used.
2760
2761
2762 \Fexecute(macroname macro-args)
2763 Execute the named macro with the given parameters (if any), return the
2764 macro's RETURN value if any (see RETURN).
2765
2766
2767 \Fcontents(variable-name)
2768 Returns the current definition (contents) of a variable. If the
2769 definition includes variable names or function references, these are
2770 copied literally, without evaluation.
2771
2772
2773 \Fdefinition(macro-name)
2774 Returns the literal definition of the named macro.
2775
2776 Here are the string functions that return a number:
2777
2778 \Flength(arg)
2779 Returns the length of the argument string.
2780
2781
2782 \Findex(arg1,arg2,arg3)
2783 Returns the position of the first occurrence string arg1 in string
2784 arg2, starting at position arg3. If arg3 is omitted, then starting at
2785 the beginning.
2786
2787 File functions:
2788
2789 \Ffiles(filespec)
2790 Returns the number of files that match the given file specification,
2791 for example \ffiles(ck*.c).
2792
2793
2794 \Fnextfile()
2795 Returns the next filename that matches the \Ffiles() file
2796 specification. Use this in a counted loop (see below) after executing
2797 \Ffiles().
2798
2799 Integer arithmetic functions:
2800
2801 \Fmax(arg1,arg2)
2802 Returns the maximum of its two numeric arguments.
2803
2804
2805 \Fmin(arg1,arg2)
2806 Returns the minimum of its two numeric arguments.
2807
2808
2809 \Feval(expression)
2810 Evaluates the given arithmetic expression. The operands of the
2811 expression can be numeric strings or variables, or functions that
2812 evaluate to numeric strings. The precedence is the normal, intuitive
2813 algebraic (or programming) precedence, and can be altered by the use of
2814 parentheses, which have higher precedence than any other operator.
2815 Spaces may be used to separate operators from operands, but they are
2816 not required.
2817
2818 Table 1-1 shows the types of expressions accepted by \feval().
2819
2820 -------------------------------------------------------------------------------
2821
2822
2823 Operator Fix Precedence Operation Example
2824
2825 ( ) 1 Group (\%a + 3) * (\%1-5)
2826 ! Post 2 Factorial \%x! - (\%x-2)!
2827
2828 ~ Pre 3 Logical NOT ~\%n
2829 - Pre 3 Negative -\%n
2830
2831 ^ In 4 Raise to power 2^\%p
2832
2833 * In 5 Multiply \%c * 5
2834 / In 5 Divide \%c / 5
2835 % In 5 Modulus \%c % 5
2836 & In 5 Logical AND \%c & 5
2837
2838 + In 6 Add \%t + \%u
2839 - In 6 Subtract 27 - \%x
2840 | In 6 Logical OR \%z | 4
2841 # In 6 Exclusive OR \%z # 4
2842 @ In 6 Greatest Common \%z @ 30
2843 Divisor
2844
2845 Table 1-1: \feval() Arithmetic Functions
2846
2847 -------------------------------------------------------------------------------
2848
2849 You can list the names of Kermit's built-in functions with the SHOW FUNCTIONS
2850 command.
2851
2852 Two Kermit commands are also available to perform simple arithmetic on
2853 variables:
2854
2855 INCREMENT name [value]
2856 Add value to the named variable. If value is omitted, add 1. If the
2857 variable does not have a numeric value, this command has no effect.
2858 Examples: inc \%a, incr \%b 10.
2859
2860
2861 DECREMENT name [value]
2862 Subtract value from the named variable. If value is omitted, subtract 1.
2863 If the variable does not have a numeric value, this command has no effect.
2864
2865
2866 1.12.5. Script Programming
2867
2868 Kermit's script programming language lets you write procedures, or programs,
2869 that can include any Kermit command. Variables and functions can be referenced
2870 at practically any point in any command. Control structures are provided for
2871 decision making, transfer of control, looping, scoping of variables, and so
2872 forth. A script program can be a TAKE file, a macro, or any combination of the
2873 two.
2874
2875 The basic idea of a script program is to automate tasks that you would normally
2876 do "by hand" when interacting with another computer: dialing the modem,
2877 negotiating through network boxes and front ends, logging in, etc etc. You can
2878 also write programs to manage local files, or to do anything that you could do
2879 manually with Kermit.
2880
2881 To automate interaction with another computer, you need a replacement for the
2882 CONNECT command. This comes in two parts, an OUTPUT command that "types" what
2883 you would type during CONNECT, and an INPUT command that reads the other
2884 computer's responses, plus a couple related commands:
2885
2886 OUTPUT text
2887 Send the text to the other computer. The text can be any combination of
2888 plain ordinary characters, backslash codes, variables, and functions.
2889
2890 INPUT timeout text
2891 Read responses from the other computer. Wait up to timeout seconds for the
2892 specified text to appear. If the text appears within the timeout interval,
2893 the command succeeds immediately. Otherwise it fails. The text can
2894 contain any combination of ordinary characters, backslash codes, variables,
2895 and functions. If you want to include leading and/or trailing blanks in
2896 the INPUT text, surround it with braces, as in:
2897
2898 input 10 {login: }
2899
2900 INPUT can be interrupted with Ctrl-C, in which case it fails.
2901
2902 REINPUT timeout text
2903 Searches previous responses from the computer for the given text. The
2904 timeout parameter is ignored. The previous responses are stored in the
2905 INPUT buffer, which is 256 characters long, and which may also be accessed
2906 via the \v(input) variable.
2907
2908 ECHO [ text ]
2909 Display the text on the local screen, followed by a newline. The text can
2910 contain any combination of backslash codes, variables, functions, etc.
2911
2912 CLEAR
2913 Clear any as-yet-unread characters from the communication device's input
2914 buffer.
2915
2916 PAUSE [ n ]
2917 Do nothing for the indicated number of seconds. If a number is not given,
2918 pause for 1 second. If anything is typed on the keyboard during the pause
2919 interval, "wake up". PAUSE can be interrupted by typing Ctrl-C (or any
2920 other character), in which case it fails.
2921
2922 WAIT [ n [ { CD, CTS, DSR } ] ]
2923 Wait up to n seconds for the specified modem signals to appear on the
2924 currently selected communication device. If you don't include any modem
2925 signal names, WAIT is equivalent to PAUSE. If you include one or more
2926 signal names (separated by spaces), Kermit will wait for all of the
2927 specified signals to appear. If they don't appear within the alloted time,
2928 or if the device does not have modem control, then the command will fail.
2929 You may interrupt the WAIT command by typing any character at the keyboard,
2930 in which case the command will fail. The command will also fail if
2931 modem-signal support is not included in C-Kermit for your particular
2932 operating system version. The modem signals are: CD (carrier detect), CTS
2933 (Clear To Send), and DSR (Data Set Ready).
2934
2935 Example:
2936
2937 wait 10 cd dsr ; Wait 5 seconds for CD and DSR.
2938 if success goto ok ; Test the result.
2939
2940 WAIT can be interrupted by typing Ctrl-C (or any other character), in which
2941 case it fails.
2942
2943 The behavior of the INPUT command can be controlled by SET INPUT:
2944
2945 SET [ INPUT ] CASE {IGNORE, OBSERVE}
2946 Tells whether alphabetic case matters when searching the remote computer's
2947 responses for the INPUT text. This setting also affects C-Kermit's other
2948 string comparison operations, including IF EQUAL, IF LGT, etc (IF command
2949 described later).
2950
2951 SET INPUT ECHO { ON, OFF }
2952 Tells whether the characters read by the INPUT command should be echoed on
2953 the screen.
2954
2955 SET INPUT TIMEOUT-ACTION { PROCEED, QUIT }
2956 Tells whether the script program should continue or stop immediately if an
2957 INPUT command fails.
2958
2959 At this point Kermit needs a decision making mechanism to tell whether the
2960 INPUT command succeeded or failed. This is the IF command. Note that IF can
2961 be used after INPUT only if you SET INPUT TIMEOUT PROCEED.
2962
2963 IF [NOT] condition command
2964 If the condition is satisfied, execute the following Kermit command. If
2965 the word NOT is included, execute the command if the condition is not
2966 satisfied. Only one command may be given, and it must appear on the same
2967 line as the IF.
2968
2969 The IF command supports a wide variety of conditions. These are:
2970
2971 IF SUCCESS
2972 The previous command succeeded.
2973
2974
2975 IF FAILURE
2976 The previous command failed.
2977
2978
2979 IF DEFINED name
2980 The named variable or macro is defined.
2981
2982
2983 IF BACKGROUND
2984 Kermit is running in the background or with its standard input and
2985 output redirected.
2986
2987
2988 IF COUNT
2989 Subtract one from COUNT, execute the command if the result is greater
2990 than zero (see SET COUNT).
2991
2992
2993 IF EXIST filename
2994 The named file exists.
2995
2996
2997 IF NUMERIC variable
2998 The variable's value is numeric.
2999
3000
3001 IF EQUAL s1 s2
3002 s1 and s2 (character strings or variables) are equal.
3003
3004
3005 IF LLT s1 s2
3006 s1 is lexically (alphabetically) less than s2. Use IF NOT LGT for
3007 less-than-or-equal.
3008
3009
3010 IF LGT s1 s1
3011 s1 is lexically (alphabetically) greater than s2. Use IF NOT LLT for
3012 greater-than-or-equal.
3013
3014
3015 IF = n1 n2
3016 n1 and n2 (numbers or variables containing numbers) are equal.
3017
3018
3019 IF < n1 n2
3020 n1 is arithmetically less than n2. Use IF NOT > for less-than-or-equal.
3021
3022
3023 IF > n1 n2
3024 n1 is arithmetically greater than n2\n. Use IF NOT < for greater-than-
3025 or-equal.
3026
3027 String comparisons in IF EQUAL, IF LGT, and IF LLT treat alphabetic case
3028 according to SET INPUT CASE {IGNORE, OBSERVE}. You can also use \fupper() and
3029 \flower() to force caseless comparisons if INPUT CASE is set to OBSERVE.
3030
3031 Arithmetic comparisons work with numeric constants, variables and array
3032 elements that evaluate to a numeric string, functions that return a numeric
3033 value, and the special "MS-DOS Kermit compatibility" variables COUNT, VERSION,
3034 and ARGC, which can only appear in this context. Numeric strings are converted
3035 to binary integers before comparison, and may be positive, zero, or negative.
3036 Floating point ("real") numbers are not supported.
3037
3038 The IF command may be followed on the next line by an ELSE command, which is
3039 executed if the IF condition is not true, and which is not executed if the IF
3040 condition is true. Example:
3041
3042 IF < \%x 10 ECHO It's less
3043 ELSE echo It's not less
3044
3045 As in any programming language, it is desirable to be able to go to different
3046 places in the program based on the decisions made by IF commands. The command
3047 for going-to is:
3048
3049 GOTO label
3050 Go to the command which follows the named label.
3051
3052 A label is a word beginning with a colon (:) on the left margin. Example:
3053
3054 IF < \%x 10 goto less
3055 echo It's not less
3056 goto fin
3057 :less
3058 ECHO It's less
3059 :fin
3060
3061 Several other commands are especially useful in conditional contexts, i.e. as
3062 objects of IF commands:
3063
3064 STOP
3065 Stop executing the current script program (TAKE file or macro) and return
3066 immediately to C-Kermit prompt level (or, if Kermit was invoked with
3067 command-line action arguments, exit C-Kermit altogether).
3068
3069 END [ n ]
3070 Go "up" one command level. Exit the currently executing macro or TAKE
3071 file, and return to the invoking TAKE file or macro. Or, if the current
3072 TAKE file or macro was invoked from C-Kermit> prompt level, return to the
3073 prompt. Or, if Kermit was invoked with command-line action arguments, exit
3074 C-Kermit. If a value is given, it is used to set the SUCCESS flag (if the
3075 value is zero) or the FAILURE flag (if the value is nonzero). You can use
3076 POP as a synonym for this command.
3077
3078 RETURN [value]
3079 For use within macros. Just like END, except that a return value may be
3080 set. This is for use with the \fexecute() function, which allows you to
3081 write user-defined functions. For example:
3082
3083 def sum if = \%1 1 return 1,-
3084 else return \feval(\%1 + \fexecute(sum \feval(\%1 - 1)))
3085
3086 This function, called SUM, returns the sum of all the numbers from 1 to
3087 whatever number (1 or greater) it was called with, for example:
3088
3089 echo \fexec(sum 5)
3090
3091 prints the number 12. Notice that this function calls itself; C-Kermit
3092 functions are allowed to do this.
3093
3094 Although the object command of an IF or ELSE statement may only be a single
3095 command, that command is allowed to be a macro invocation or a TAKE command.
3096 This provides a kind of statement grouping that can be used to avoid a lot of
3097 confusing GOTOs. A more flexible kind of statement grouping is available in
3098 the XIF ("extended IF") command:
3099
3100 XIF condition { command-list } [ ELSE { command-list } ]
3101 In this extended form, braces are required to enclose a comma-separated
3102 list of one or more commands, and the ELSE clause is on the same line as
3103 the XIF. Example:
3104
3105 xif < \%x 10 {ech Less,def \%m 10} else {ec Not less,def \%m \%x}
3106
3107 Here the appropriate message is echoed, depending on the value of \%x, and
3108 the minimum of \%x and 10 is assigned to the variable \%m. Commands like
3109 this one can be broken onto multiple lines for clarity, but only if you use
3110 dash (or backslash) for line continuation:
3111
3112 xif < \%x 10 { -
3113 echo Less, -
3114 def \%m 10 -
3115 } else { -
3116 echo Not less, -
3117 def \%m \%x -
3118 }
3119
3120 WARNING: RETURN or END statements should not be used within an XIF command.
3121
3122
3123 Other Ways of Assigning Values to Variables
3124
3125 Sometimes it is desirable for a script program to interact with you as well as
3126 with the remote computer. For example, you should not store passwords on disk,
3127 so you can't write script programs that contain them. However, you can write
3128 script programs that prompt you for your password. This is done using the ASK
3129 or ASKQ command:
3130
3131 ASK name prompt
3132 Print the prompt on the screen and wait for you to type a line of text
3133 (terminated by carriage return), and assign this line of text to the named
3134 variable (but without the carriage return), for example:
3135
3136 ask \%p Password:
3137 output \%p\13
3138
3139 The prompt may be enclosed in { curly braces } to retain leading and/or
3140 trailing spaces.
3141
3142 ASKQ name prompt
3143 Just like ASK, but it "asks quietly". The characters you type do not echo.
3144 Especially useful for passwords.
3145
3146 GETOK text
3147 Asks a "yes or no" question. The text is the question. Enclose it in curly
3148 braces to preserve leading or trailing spaces. If the user replies "Yes" or
3149 "OK" (or any abbreviation of these), the SUCCESS flag is set (for IF SUCCESS).
3150 If she replies "N" or "No", the FAILURE flag is set.
3151
3152 Now, with IF, branching, ASK, and so forth, we can add to our login script:
3153
3154 define error echo Error: \%1, end ; Error-handling macro.
3155 set input timeout proceed ; Don't quit if INPUT fails.
3156 set input case ignore ; Alphabetic case doesn't matter.
3157 set input echo off ; Don't need to watch.
3158 output \13 ; Send carriage return (ASCII 13).
3159 input 5 login: ; Wait 5 secs for "login:" prompt.
3160 if fail error {No login prompt} ; Give up if it doesn't come.
3161 output myuserid\13 ; Send user ID followed by CR.
3162 input 5 password: ; Wait for password prompt.
3163 if fail error {No password prompt} ; Give up if it doesn't come.
3164 ask \%p Password: ; Prompt user for password
3165 output \%p\13 ; Send it, followed by CR
3166 input 30 $\32 ; Wait for system prompt "$ "
3167 if fail error {No system prompt} ; Give up if it doesn't come.
3168 connect ; Got it, connect.
3169
3170
3171 Reading and Writing Local Files
3172
3173 It is also possible to assign data from local files to variables. In fact,
3174 C-Kermit includes an entire input and output system for local files and
3175 commands:
3176
3177 OPEN mode filename
3178 For use with READ and WRITE commands. Open the local file in the specified
3179 mode: READ, WRITE, or APPEND. !READ and !WRITE mean to read from or write
3180 to a system command rather than a file. Examples:
3181
3182 OPEN READ oofa.txt
3183 OPEN !READ ls ck[uwc].[cwh]
3184
3185 The first example reads lines from the file oofa.txt. The second reads
3186 filenames from a Unix directory listing; this gives you a way to select
3187 files using your Unix shell's filename-matching metacharacters, which are
3188 more powerful than Kermit's built-in ones.
3189
3190 READ name
3191 The next line from the current OPEN READ or OPEN !READ file is assigned to
3192 the named variable, for example READ \%A. If no more lines remain in the
3193 file, the command fails.
3194
3195 WRITE name text
3196 Writes the given text to the named log or file. The text text may include
3197 backslash codes, and is not terminated by a newline unless you include the
3198 appropriate code. The name parameter can be any of the following:
3199
3200 DEBUG-LOG
3201 FILE (the OPEN WRITE, OPEN !WRITE, or OPEN APPEND file).
3202 PACKET-LOG
3203 SCREEN (just like ECHO except that WRITE does not supply a line terminator)
3204 SESSION-LOG
3205 TRANSACTION-LOG
3206
3207 CLOSE name
3208 Closes the named file. A READ or !READ file is closed automatically when
3209 end-of-file (EOF) is encountered during a READ operation, but it does no
3210 harm to close it again. WRITE, !WRITE, and APPEND files must be closed
3211 explicitly. Examples: CLOSE READ, CLOSE WRITE.
3212
3213 A typical script program for reading and writing files might look like this:
3214
3215 set take error off ; So EOF can be handled.
3216 open read foo ; Open input file "foo".
3217 open write bar ; Open output file "bar".
3218 def \%c 0 ; Make a line counter.
3219 :loop ; Loop to read all lines.
3220 read \%a ; Read one line into \%a.
3221 if fail goto done ; Catch EOF this way.
3222 increment \%c ; Count the line.
3223 write file \%c. \fupp(\%a)\10 ; Format and write it.
3224 goto loop ; Go back and get more.
3225 :done
3226 close read ; Finished,
3227 close write ; close the files.
3228 echo All done. ; Print a message.
3229
3230 The previous example shows a loop, which is a common programming construct. It
3231 is always desirable to avoid infinite loops. The READ example does this by
3232 testing for end of file (EOF) with IF FAILURE.
3233
3234
3235 Counted Loops
3236
3237 Kermit also provides for "finite", or counted, loops, in several varieties:
3238
3239 SET COUNT / IF COUNT
3240 Here a special variable, COUNT, is set. The IF COUNT command decrements
3241 the count variable, and if the result is greater than zero, executes the
3242 object command:
3243
3244 set count 5
3245 :loop
3246 echo \v(count)
3247 if count goto loop
3248 else echo Zero!
3249
3250 FOR variable iv fv step { command, command, ... }
3251 The FOR loop is controlled by a loop variable which is assigned an initial
3252 value (iv), gets tested against a final value (fv), and gets incremented by
3253 a step value. If the step value is positive, the loop exits when the loop
3254 variable is greater than the final value. If the step is negative, the
3255 loop exits when the variable becomes less than the final value. Example
3256 (cute way to print the 9's times table):
3257
3258 for \%i 0 9 1 { assign \%j \feval(9-\%i), echo \%i\%j }
3259
3260 FOR loops can be nested:
3261
3262 for \%i 1 5 1 { for \%j 5 \%i -1 { echo \%i:\%j } }
3263
3264 WHILE condition { command, command, ... }
3265 The commands are executed as long as the condition is true. The conditions
3266 are the same as for the IF command. Example:
3267
3268 while not exist foo.bar { sleep 1 }
3269
3270 This loop waits until file named foo.bar appears.
3271
3272 FOR and WHILE loops can be nested in any combination. Both FOR and WHILE loops
3273 may be exited or continued prematurely using the following commands:
3274
3275 BREAK
3276 Exit from the closest enclosing FOR or WHILE loop.
3277
3278 CONTINUE
3279 Begin the next iteration (if any) of the closest enclosing FOR or WHILE
3280 loop immediately.
3281
3282 WARNING: RETURN and END commands should not be used in the object commands of
3283 FOR, WHILE, or XIF.
3284
3285 Here's a script program example that has nothing to do with data communication
3286 or file transfer, but which illustrates the control structures of the script
3287 language, the use of arrays, statement grouping, file i/o, etc:
3288
3289 ; Kermit script program to read a file of numbers into an array,
3290 ; sort the array numerically, and display the sorted result.
3291 ;
3292 def \%d 100 ; Allow up to 100 elements.
3293 dcl &a[\%d] ; Declare a 100-element array.
3294 set take error off ; To handle EOF on READ.
3295 open read numbers.dat ; Open this file for reading.
3296
3297 ; Read each line into a separate array element
3298 ;
3299 echo Reading...
3300 for \%n 1 \%d 1 { -
3301 read \&a[\%n], -
3302 if fail break -
3303 }
3304 decr \%n ; Subtract one for read that failed.
3305 ; Check for too many lines.
3306 xif > \%n \%d { -
3307 echo Too many lines in file, -
3308 stop -
3309 }
3310 echo Array initialized: \%n elements, sorting...
3311
3312 ; Sort the array using the (slow) "bubble sort" algorithm.
3313 ;
3314 assign \%m \feval(\%n-1)
3315 for \%i 1 \%m 1 { -
3316 for \%j \%i \%n 1 { -
3317 xif > \&a[\%i] \&a[\%j] { -
3318 assign \%t \&a[\%i], -
3319 assign \&a[\%i] \&a[\%j], -
3320 assign \&a[\%j] \%t -
3321 } -
3322 } -
3323 }
3324
3325 ; Display the sorted array.
3326 ;
3327 echo sorted.
3328 for \%i 1 \%n 1 { echo \flpad(\%i,3). \flpad(\&a[\%i],5) }
3329
3330
3331 1.13. The SCRIPT Command
3332
3333 The SCRIPT command allows connection and login sequences to be specified in a
3334 single, cryptic line in the style of the Unix uucp L.sys file.
3335
3336 Syntax: SCRIPT expect send [expect send] . . .
3337
3338 "expect" has the syntax: expect[-send-expect[-send-expect[...]]]
3339
3340 The SCRIPT command carries on a "canned dialog" with a remote system, in which
3341 data is sent according to the remote system's responses. The typical use is
3342 for logging in to a remote system automatically.
3343
3344 A login script is a sequence of the form:
3345
3346 expect send [expect send] . . .
3347
3348 where expect is a prompt or message to be issued by the remote site, and send
3349 is the string (names, numbers, etc) to return, and expects are separated from
3350 sends by spaces. The send may also be the keyword EOT, to send Control-D, or
3351 BREAK, to send a break signal. Letters in sends may be prefixed by `~' to send
3352 special characters, including:
3353
3354 ~b backspace
3355 ~s space
3356 ~q `?'(trapped by Kermit's command interpreter)
3357 ~n linefeed
3358 ~r carriage return
3359 ~t tab
3360 ~' single quote
3361 ~~ tilde
3362 ~" double quote
3363 ~x XON (Control-Q)
3364 ~c don't append a carriage return
3365 ~o[o[o]] octal representation of an ASCII character code
3366 ~d delay approx 1/3 second during send
3367 ~w[d[d]] wait specified interval during expect, then time out
3368 \\b send a BREAK signal
3369
3370 As with some UUCP systems, sent strings are followed by ~r unless they have a
3371 ~c.
3372
3373 Only the last 7 characters in each expect are matched. A null expect, e.g. ~0
3374 or two adjacent dashes, causes a short delay before proceeding to the next send
3375 sequence. A null expect always succeeds.
3376
3377 As with UUCP, if the expect string does not arrive, the script attempt fails.
3378 If you expect that a sequence might not arrive, as with UUCP, conditional
3379 sequences may be expressed in the form:
3380
3381 -send-expect[-send-expect[...]]
3382
3383 where dashed sequences are followed as long as previous expects fail. Timeouts
3384 for expects can be specified using ~w; ~w with no arguments waits 15 seconds.
3385
3386 expect-send transactions can be easily be debugged by logging transactions.
3387 This records all exchanges, both expected and actual. The script execution
3388 will also be logged in the session log, if that is activated.
3389
3390 Note that `\' characters in login scripts, as in any other C-Kermit interactive
3391 commands, must be doubled up. A line may be ended with a single `\' for
3392 continuation.
3393
3394 Example one:
3395
3396 Using a modem, dial a UNIX host site. Expect "login" (...gin), and if it
3397 doesn't come, simply send a null string with a ~r. (Some Unixes require either
3398 an EOT or a BREAK instead of the null sequence, depending on the particular
3399 site's "logger" program.) After providing user id and password, respond "x" to
3400 a question-mark prompt, expect the Bourne shell "$" prompt (and send return if
3401 it doesn't arrive). Then cd to directory kermit, and run the program called
3402 "wermit", entering the interactive connect state after wermit is loaded.
3403
3404 set modem ventel
3405 set line /dev/tty77
3406 set baud 1200
3407 dial 9&5551212
3408 script gin:--gin:--gin: smith ssword: mysecret ~q x $--$ \
3409 cd~skermit $ wermit
3410 connect
3411
3412 Note that SET LINE is issued after SET MODEM, but before SET BAUD or other
3413 line-related parameters.
3414
3415 Example two:
3416
3417 Using a modem, dial the Telenet network. This network expects three returns
3418 with slight delays between them. These are sent following null expects. The
3419 single return is here sent as a null string, with a return appended by default.
3420 Four returns are sent to be safe before looking for the prompt. Then the
3421 Telenet id and password are entered. Then Telenet is instructed to connect to
3422 a host site (c 12345). The host has a data switch that asks "which system";
3423 the script responds "myhost" (if the "which system" prompt doesn't appear, the
3424 Telenet connect command is reissued). The script waits for an "@" prompt from
3425 the host, then sends the user ID ("joe") and password ("secret"), looks for
3426 another "@" prompt, runs Kermit, and in response to the Kermit's prompt (which
3427 ends in ">"), gives the commands "set parity even" and "server". Files are
3428 then exchanged. The commands are in a take file; note the continuation of the
3429 'script' command onto several lines using the `\' terminator.
3430
3431 set modem hayes
3432 set line /dev/acu
3433 set speed 1200
3434 set parity mark
3435 dial 9,5551212
3436 script ~0 ~0 ~0 ~0 ~0 ~0 ~0 ~0 @--@--@ id~s\
3437 aa001122 = 002211 @ c~s12345 ystem-c~s12345-ystem \
3438 myhost @ joe~ssecret @ kermit > set~sparity~seven > server
3439 send some.stuff
3440 get some.otherstuff
3441 bye
3442 quit
3443
3444 Since these commands may be executed totally in the background, they can also
3445 be scheduled. A typical shell script, which might be scheduled by cron, would
3446 be as follows (csh used for this example):
3447
3448 #
3449 # Keep trying to dial and log onto remote host and exchange
3450 # files, wait 10 minutes before retrying if it fails.
3451 #
3452 cd someplace
3453 while ( 1 )
3454 kermit < ./tonight.cmd >> nightly.log &
3455 if ( ! $status ) break
3456 sleep 600
3457 end
3458
3459 File tonight.cmd might have two takes in it, for example, one to take a file
3460 with the set modem, set line, set baud, dial, and script, and a second take of
3461 a file with send/get commands for the remote server. The last lines of
3462 tonight.cmd should be BYE and QUIT.
3463
3464
3465 1.14. Command Line Operation
3466
3467 A subset of Kermit's commands is available using Unix-style command line
3468 options, on operating systems that support passing of command-line options to
3469 programs through the "argv, argc" mechanism.
3470
3471 The C-Kermit command line syntax conforms to the Proposed Syntax Standards for
3472 Unix System Commands put forth by Kathy Hemenway and Helene Armitage of AT&T
3473 Bell Laboratories in Unix/World, Vol.1, No.3, 1984. The rules that apply are:
3474
3475 - Command names must be between 2 and 9 characters ("kermit" is 6).
3476 - Command names must include lower case letters and digits only.
3477 - An option name is a single character.
3478 - Options are delimited by '-'.
3479 - Options with no arguments may be grouped (bundled) behind one
3480 delimiter.
3481 - Option-arguments cannot be optional.
3482 - Arguments immediately follow options, separated by whitespace.
3483 - The order of options does not matter.
3484 - '-' preceded and followed by whitespace means standard input.
3485
3486 A group of bundled options may end with an option that has an argument.
3487
3488 The following notation is used in command descriptions:
3489
3490 fn A file specification, possibly containing the "wildcard" characters `*'
3491 or `?' (`*' matches all character strings, `?' matches any single
3492 character).
3493
3494
3495 fn1 A Unix file specification which may not contain `*' or `?'.
3496
3497
3498 rfn A remote file specification in the remote system's own syntax, which
3499 may denote a single file or a group of files.
3500
3501
3502 rfn1
3503 A remote file specification which should denote only a single file.
3504
3505
3506 n A decimal number between 0 and 94.
3507
3508
3509 c A decimal number between 0 and 127 representing the value of an ASCII
3510 character.
3511
3512
3513 cc A decimal number between 0 and 31, or else exactly 127, representing
3514 the value of an ASCII control character.
3515
3516
3517 [ ] Any field in square braces is optional.
3518
3519
3520 {x,y,z}
3521 Alternatives are listed in curly braces.
3522
3523 C-Kermit command line options may specify any combination of actions and
3524 settings. If C-Kermit is invoked with a command line that specifies no
3525 actions, then it will issue a prompt and begin interactive dialog. Action
3526 options specify either protocol transactions or terminal connection.
3527
3528 An implicit TAKE command is executed upon your C-Kermit initialization file
3529 when C-Kermit starts up, upon either interactive or command-line invocation.
3530 This file may contain C-Kermit interactive-mode commands, which are explained
3531 later.
3532
3533 In addition, if the first command line argument is the name of an existing
3534 file, C-Kermit will read that file and execute Kermit interactive-mode commands
3535 from it, in addition to (and after) your initialization file (if any).
3536 Example:
3537
3538 $ kermit cmdfile -b 3 -p m
3539
3540 In UNIX, this feature allows you to invoke C-Kermit by "running" a C-Kermit
3541 command file, if its first line is of the form:
3542
3543 #!/dir/kermit
3544
3545 That is, number sign followed by exclamation point, followed by the full file
3546 specification of the Kermit program. You must also give this file execute
3547 permission:
3548
3549 $ chmod +x cmdfile
3550
3551 Then you can run this file as if it were a program, and it will feed itself to
3552 C-Kermit automatically:
3553
3554 $ cmdfile
3555
3556 You can even include C-Kermit command line options:
3557
3558 $ cmdfile -l /dev/ttyh8 -p e
3559
3560 If you want the shell prompt to return automatically at the end of this file,
3561 include an EXIT command. Otherwise you will receive the C-Kermit prompt when
3562 the file is finished.
3563
3564 Here are C-Kermit's command-line options:
3565
3566 = Ignore all command-line options that follow (but make them available to
3567 the user in the array \&@[]).
3568
3569
3570 -y fn
3571 Read commands from the specified file instead of the standard
3572 initialization file. If you want to start Kermit with no
3573 initialization file at all, use this option and specify the null file
3574 (/dev/null or NL:).
3575
3576
3577 -s fn
3578 Send the specified file or files. If fn contains wildcard (meta)
3579 characters, the Unix shell expands it into a list. On non-Unix
3580 systems, Kermit expands any wildcard characters. fn may also be a list
3581 of files, as in:
3582
3583 kermit -s ckcmai.c ckuker.h mail.txt
3584
3585 If fn is '-' then kermit sends from standard input, which may come from
3586 a file:
3587
3588 kermit -s - < foo.bar
3589
3590 or a parallel process:
3591
3592 ls -l | grep cmg | kermit -s -
3593
3594 You cannot use this mechanism to send terminal typein. If you want to
3595 send a file whose actual name is "-" you can precede it with a path
3596 name, as in
3597
3598 kermit -s ./-
3599
3600
3601
3602 -r Receive a file or files. Wait passively for files to arrive.
3603
3604
3605 -k Receive (passively) a file or files, sending them to standard output.
3606 This option can be used in several ways:
3607
3608 kermit -k
3609 Displays the incoming files on your screen; to be used only in
3610 "local mode" (see below).
3611
3612
3613 kermit -k > fn1
3614 Sends the incoming file or files to the named file, fn1. If more
3615 than one file arrives, all are concatenated together into the
3616 single file fn1.
3617
3618
3619 kermit -k | command
3620 Pipes the incoming data (single or multiple files) to the indicated
3621 command, as in
3622
3623 kermit -k | sort > sorted.stuff
3624
3625
3626
3627 -a fn1
3628 If you have specified a file transfer option, you may give an alternate
3629 name for a single file with the -a ("as") option. For example,
3630
3631 kermit -s foo -a bar
3632
3633 sends the file foo telling the receiver that its name is bar. If more
3634 than one file arrives or is sent, only the first file is affected by
3635 the -a option:
3636
3637 kermit -ra baz
3638
3639 stores the first incoming file under the name baz.
3640
3641
3642 -x Begin server operation. May be used in either local or remote mode.
3643
3644 Before proceeding, a few words about remote and local operation are necessary.
3645 C-Kermit is "local" if it is running on PC or workstation that you are using
3646 directly, or if it is running on a multiuser system and transferring files over
3647 an external communication line -- not your job's controlling terminal or
3648 console. C-Kermit is remote if it is running on a multiuser system and
3649 transferring files over its own controlling terminal's communication line
3650 (normally /dev/tty), connected to your PC or workstation.
3651
3652 If you are running C-Kermit on a PC, it is normally used in local mode, with
3653 the "back port" designated for file transfer and terminal connection, and the
3654 keyboard and screen available to control or interrupt the file transfer and to
3655 display its status. If you are running C-Kermit on a multiuser (timesharing)
3656 system, it is in remote mode unless you explicitly point it at an external line
3657 for file transfer or terminal connection. The following command determines
3658 whether C-Kermit is in local or remote mode:
3659
3660 -l dev
3661 Line -- Specify a terminal line to use for file transfer and terminal
3662 connection, as in
3663
3664 kermit -l /dev/ttyi5
3665
3666 You can also give an open file descriptor for a tty device. In this
3667 case you should also specify the speed:
3668
3669 kermit -l 3 -b 2400
3670
3671 When an external line is being used, you will also need some additional options
3672 for successful communication with the remote system:
3673
3674 -b n
3675 Bits per second -- Specify the transmission speed in bits per second
3676 ("baud rate") for the line given in the -l option, as in:
3677
3678 kermit -l /dev/ttyi5 -b 9600
3679
3680 This option should always be included with the -l option, since the
3681 speed of an external line is not necessarily what you expect.
3682
3683
3684 -p x
3685 Parity -- e,o,m,s,n (even, odd, mark, space, or none). If parity is
3686 other than none, then Kermit's 8th-bit prefixing mechanism will be used
3687 for transferring 8-bit binary data, provided the opposite Kermit
3688 agrees. The default parity is none.
3689
3690
3691 -t Specifies half duplex, line turnaround with XON as the handshake
3692 character.
3693
3694
3695 -mname
3696 Modem type -- hayes, penril, vadic, etc. For a complete and up-to-date
3697 list, run C-Kermit interactively and type "set modem ?". Note: name
3698 must be given in lowercase, but can be abbreviated, e.g. "hay" for
3699 "hayes".
3700
3701 If you wish to use a network connection rather than a terminal line for
3702 communication, use the -j option rather -l:
3703
3704 -j name
3705 Host -- Specify a network host name. This option is currently
3706 supported for TCP/IP Telnet connections on Berkeley-based UNIX
3707 implementations only, and for VAX/VMS when equipped with TGV MultiNet
3708 TCP/IP. The speed (-b) parameter does not apply to network
3709 connections.
3710
3711 The following commands may be used only with a C-Kermit which is in local mode.
3712
3713 -g rfn
3714 Actively request a remote server to send the named file or files; rfn
3715 is a file specification in the remote host's own syntax. If fn happens
3716 to contain any special shell characters, like space, '*', '[', '~',
3717 etc, these must be quoted, as in:
3718
3719 kermit -g x\*.\?
3720
3721 or:
3722
3723 kermit -g "profile exec"
3724
3725
3726
3727 -f Send a 'finish' command to a remote server.
3728
3729
3730 -c Establish a terminal connection over the specified or default
3731 communication line, before any protocol transaction takes place. Get
3732 back to the local system by typing the escape character (normally
3733 Control-Backslash) followed by the letter 'c'.
3734
3735
3736 -n Like -c, but after a protocol transaction takes place; -c and -n may
3737 both be used in the same command. The use of -n and -c is illustrated
3738 below.
3739
3740 If the other Kermit is on a remote system, the -l and -b options should also be
3741 included with the -r, -k, or -s options.
3742
3743 Several other command-line options are provided:
3744
3745 -i Specifies that files should be sent or received exactly "as is" with no
3746 conversions. This option is necessary for transmitting binary files.
3747 It may also be used in Unix-to-Unix transfers (it must be given to both
3748 Unix Kermit programs), where it will improve performance by
3749 circumventing the normal text-file conversions, and will allow mixture
3750 of text and binary files in a single file group.
3751
3752
3753 -w Writeover -- An incoming file should write over any existing file of
3754 the same name. Changes the default behavior, which is to back up the
3755 existing file before creating the new one.
3756
3757
3758 -e n
3759 Extended packet length -- Specify that C-Kermit is allowed to receive
3760 packets up to length n, where n may be between 10 and some large
3761 number, like 1000 or 2000, depending on the system. The default
3762 maximum length for received packets is 90. Packets longer than 94 will
3763 be used only if the other Kermit supports, and agrees to use, the "long
3764 packet" protocol extension, and if you request them.
3765
3766
3767 -v n
3768 Window size -- Specify that C-Kermit is allowed to send and receive
3769 files using a window size of n. That is, up to n packets may be sent
3770 before acknowledgements are required. This speeds up transfers in most
3771 situations, especially long distance network connections. Default
3772 window size is 1, maximum is 32. Sizes greater than 1 work only if the
3773 other Kermit supports this option.
3774
3775
3776 -q Quiet -- Suppress screen update during file transfer, for instance to
3777 allow a file transfer to proceed in the background.
3778
3779
3780 -z Force foreground mode: even if Kermit thinks it is running in the
3781 background, this will make it issue its normal prompts and messages.
3782 Example:
3783
3784 kermit -z | vt100
3785
3786
3787
3788 -d Debug -- Record debugging information in the file debug.log in the
3789 current directory. Use this option if you believe the program is
3790 misbehaving, and show the resulting log to your local Kermit
3791 maintainer.
3792
3793
3794 -h Help -- Display a brief synopsis of the command line options.
3795
3796 The command line may contain no more than one protocol action option.
3797
3798 Files are sent with their own names, except that lowercase letters are raised
3799 to upper, pathnames are stripped off, certain special characters like (`~') and
3800 (`#') are changed to `X', and if the file name begins with a period, an `X' is
3801 inserted before it. Incoming files are stored under their own names except
3802 that uppercase letters are lowered, and, if -w was specified, a "generation
3803 number" is appended to the name if it has the same name as an existing file
3804 which would otherwise be overwritten. If the -a option is included, then the
3805 same rules apply to its argument. The file transfer display shows any
3806 transformations performed upon filenames.
3807
3808 During transmission, files are encoded as follows:
3809
3810 - Control characters are converted to prefixed printables.
3811
3812 - Sequences of repeated characters are collapsed via repeat counts, if
3813 the other Kermit is also capable of repeated-character compression.
3814 This feature is negotiated automatically.
3815
3816 - If parity is being used on the communication line, data characters
3817 with the 8th (parity) bit on are specially prefixed, provided the
3818 other Kermit is capable of 8th-bit prefixing; if not, 8-bit binary
3819 files cannot be successfully transferred. This feature is negotiated
3820 if you give the -p option.
3821
3822 - Conversion is done between Unix newlines and carriage-return-linefeed
3823 sequences unless the -i option was specified.
3824
3825
3826 Command Line Examples:
3827
3828
3829 kermit -l /dev/ttyi5 -b 1200 -cn -r
3830
3831 This command connects you to the system on the other end of ttyi5 at 1200 baud,
3832 where you presumably log in and run Kermit with a SEND command. After you
3833 escape back, C-Kermit waits for a file (or files) to arrive. When the file
3834 transfer is completed, you are reconnected to the remote system so that you can
3835 logout.
3836
3837
3838 kermit -l /dev/ttyi4 -b 1800 -cntp m -r -a foo
3839
3840 This command is like the preceding one, except the remote system in this case
3841 uses half duplex communication with mark parity. The first file that arrives
3842 is stored under the name foo.
3843
3844
3845 kermit -l /dev/ttyi6 -b 9600 -c | tek
3846
3847 This example uses Kermit to connect your terminal to the system at the other
3848 end of ttyi6. The C-Kermit terminal connection does not provide any particular
3849 terminal emulation, so C-Kermit's standard i/o is piped through a
3850 (hypothetical) program called tek, which performs (say) Tektronix emulation.
3851
3852
3853 kermit -l /dev/ttyi6 -b 9600 -nf
3854
3855 This command would be used to shut down a remote server and then connect to the
3856 remote system, in order to log out or to make further use of it. The -n option
3857 is invoked after -f (-c would have been invoked before).
3858 kermit -l /dev/ttyi6 -b 9600 -qg foo.\* &
3859
3860 This command causes C-Kermit to be invoked in the background, getting a group
3861 of files from a remote server (note the quoting of the `*' character). No
3862 display occurs on the screen, and the keyboard is not sampled for interruption
3863 commands. This allows other work to be done while file transfers proceed in
3864 the background. UNIX only.
3865
3866
3867 kermit -l /dev/ttyi6 -b 9600 -g foo.\* > foo.log < /dev/null &
3868
3869 This command is like the previous one, except the file transfer display has
3870 been redirected to the file foo.log. Standard input is also redirected, to
3871 prevent C-Kermit from sampling it for interruption commands.
3872
3873
3874 kermit -iwx
3875
3876 This command starts up C-Kermit as a server. Files are transmitted with no
3877 newline/carriage-return-linefeed conversion; the -i option is necessary for
3878 binary file transfer and recommended for Unix-to-Unix transfers. Incoming
3879 files that have the same names as existing files are given new, unique names.
3880
3881
3882 kermit -l /dev/ttyi6 -b 9600
3883
3884 This command sets the communication line and speed. Since no action is
3885 specified, C-Kermit issues a prompt and enters an interactive dialog with you.
3886 Any settings given on the command line remain in force during the dialog,
3887 unless explicitly changed.
3888
3889
3890 kermit
3891
3892 This command starts up Kermit interactively with all default settings.
3893
3894 The next example shows how Unix Kermit might be used to send an entire
3895 directory tree from one Unix system to another, using the tar program as
3896 Kermit's standard input and output. On the orginating system, in this case the
3897 remote, type (for instance):
3898
3899
3900 tar cf - /usr/fdc | kermit -is -
3901
3902 This causes tar to send the directory /usr/fdc (and all its files and all its
3903 subdirectories and all their files...) to standard output instead of to a tape;
3904 kermit receives this as standard input and sends it as a binary file. On the
3905 receiving system, in this case the local one, type (for instance):
3906
3907
3908 kermit -il /dev/ttyi5 -b 9600 -k | tar xf -
3909
3910 Kermit receives the tar archive, and sends it via standard output to its own
3911 copy of tar, which extracts from it a replica of the original directory tree.
3912
3913 A final example shows how a Unix compression utility might be used to speed up
3914 Kermit file transfers:
3915
3916 compress file | kermit -is - (sender)
3917 kermit -ik | uncompress (receiver)
3918
3919
3920 1.15. UNIX Specifics
3921
3922 1.15.1. The Unix File System
3923
3924 Consult your Unix manual for details about the file system under your version
3925 of Unix. In general, Unix files have lowercase names, possibly containing one
3926 or more dots or other special characters. Unix directories are tree-
3927 structured. Directory levels are separated by slash ("/") characters. For
3928 example,
3929
3930 /usr/foo/bar
3931
3932 denotes the file bar in the directory /usr/foo. Alphabetic case is significant
3933 in Unix file and directory names, i.e. "a" is a different file (or directory)
3934 from "A". Wildcard or "meta" characters allow groups of files to be specified.
3935 "*" matches any string; "?" matches any single character.
3936
3937 When C-Kermit is invoked with file arguments specified on the Unix command
3938 line, the Unix shell (Bourne Shell, C-Shell, K-Shell, etc) expands the meta
3939 characters itself, and in this case a wider variety is available. For example,
3940
3941 kermit -s ~/ck[uvm]*.{upd,bwr}]
3942
3943 is expanded by the Berkeley C-Shell into a list of all the files in the user's
3944 home directory (~/) that start with the characters "ck", followed by a single
3945 character "u", "v", or "m", followed by zero or more characters, followed by a
3946 dot, followed by one of the strings "upd" or "bwr". Internally, the C-Kermit
3947 program itself expands only the "*" and "?" meta characters.
3948
3949 Unix files are linear (sequential) streams of 8-bit bytes. Text files consist
3950 of 7-bit ASCII or ISO-646 NRC characters, with the high-order bit off (0), or
3951 in very recent versions of Unix, of 8-bit characters in an ASCII-based
3952 international standard character set such as ISO 8859 Latin Alphabet 1. Text
3953 file lines are separated by the Unix newline character, which is linefeed (LF,
3954 ASCII 10). This distinguishes Unix text files from those on most other
3955 ASCII-based stream file systems, in which lines are separated by a carriage-
3956 return linefeed sequence (CRLF, ASCII 13, followed by linefeed, ASCII 10).
3957 Binary files are likely to contain data in the high bits of the file bytes, and
3958 have no particular line or record structure.
3959
3960
3961 1.15.2. UUCP Lock Files
3962
3963 Unix has no built-in way of obtaining exclusive access to an external
3964 communication line. When you issue the 'set line' command to Unix Kermit, Unix
3965 would normally grant you access to the line even if some other process is
3966 making use of it. The method adopted by most Unix systems to handle this
3967 situation is the "UUCP lock file". UUCP, the Unix-to-Unix Copy program,
3968 creates a file in its directory (usually /usr/spool/uucp, but often elsewhere)
3969 with a name like LCK..name, where name is the device name, for instance
3970 LCK..tty07.
3971
3972 Unix Kermit uses UUCP lock files in order to avoid conflicts with UUCP, tip, or
3973 other programs that follow this convention, including other users running
3974 Kermit itself. Whenever you attempt to access an external line using the 'set
3975 line' command or `-l' on the command line, Kermit looks in the UUCP directory
3976 for a lock file corresponding to that device. For instance, if you 'set line
3977 /dev/ttyi6' then Kermit looks for the file
3978
3979 /usr/spool/uucp/LCK..ttyi6
3980
3981 If it finds this file, it gives you an error message and a directory listing of
3982 the file so that you can see who is using it, e.g.
3983
3984 -r--r--r-- 1 fdc 8 Feb 7 13:02 /usr/spool/uucp/LCK..ttyi6
3985
3986 In this case, you would look up user fdc to find out how soon the line will
3987 become free.
3988
3989 This convention requires that the uucp directory be publicly readable and
3990 writable. If it is not, the program will issue an appropriate warning message.
3991
3992 If no lock file is found, Unix Kermit will attempt create one, thus preventing
3993 anyone who subsequently tries to run Kermit, UUCP, cu, tip, or similar programs
3994 on the same line from gaining access until you release the line. If Kermit
3995 could not create the lock file (for instance because the uucp directory is
3996 write-protected), then you will receive an error message.
3997
3998 Even when the lock directory is writable and readable, the locking mechanism
3999 depends upon all users using the same name for the same device. If a device
4000 has more than one path associated with it, then a lock can be circumvented by
4001 using an alias.
4002
4003 When a lock-creating program abruptly terminates, e.g. because it crashes or is
4004 killed via shell command, the lock file remains in the uucp directory,
4005 spuriously indicating that the line is in use. If the lock file is owned by
4006 yourself, you may remove it. Otherwise, you'll have to get the owner or the
4007 system manager to remove it, or else wait for a system task to do so; uucp
4008 supports a function (uuclean) which removes these files after a predetermined
4009 age -- uucp sites tend to run this function periodically via crontab.
4010
4011 Locking is not needed, or used, if communications occur over the user's login
4012 terminal line (normally /dev/tty).
4013
4014
4015 1.15.3. C-Kermit under Berkeley or System III/V Unix
4016
4017 C-Kermit may be interrupted at command level or during file transfer by typing
4018 Control-C. The program will perform its normal exit function, restoring the
4019 terminal and releasing any lock. If a protocol transaction was in progress, an
4020 error packet will be sent to the opposite Kermit so that it can terminate
4021 cleanly.
4022
4023 C-Kermit may be invoked in the background ("&" on shell commmand line). If a
4024 background process is "killed", the user will have to manually remove any lock
4025 file and may need to restore the modem. This is because the kill signal
4026 (kill(x,9)) cannot be trapped by Kermit.
4027
4028 During execution of a system command ('directory', 'cd', or `!'), C-Kermit can
4029 often be returned to command level by typing a single Control-C. (With System
4030 III/V, the usual interrupt function (often the DEL key) is replaced by
4031 Control-C.)
4032
4033 Under Berkeley Unix only: C-Kermit may also be interrupted by ^Z to put the
4034 process in the background.
4035
4036 Control-C, Control-Z, and Control-\ lose their normal functions during terminal
4037 connection and also during file transfer when the controlling tty line is being
4038 used for packet i/o.
4039
4040 If you are running C-Kermit in "quiet mode" in the foreground, then
4041 interrupting the program with a console interrupt like Control-C will not
4042 restore the terminal to normal conversational operation. This is because the
4043 system call to enable console interrupt traps will cause the program to block
4044 if it's running in the background, and the primary reason for quiet mode is to
4045 allow the program to run in the background without blocking, so that you can do
4046 other work in the foreground.
4047
4048 If C-Kermit is run in the background ("&" on shell commmand line), then the
4049 interrupt signal (Control-C) (and System III/V quit signal) are ignored. This
4050 prevents an interrupt signal intended for a foreground job (say a compilation)
4051 from being trapped by a background Kermit session.
4052
4053
4054 1.15.4. C-Kermit on the AT&T UNIX PC
4055
4056 For Unix PC owners here are a couple of hints. The name of the phone line
4057 devices are /dev/ph0 and /dev/ph1. The RS232 serial port is /dev/tty000.
4058
4059 Dialing out with the internal modem:
4060
4061 C-Kermit>set line /dev/ph0
4062 C-Kermit>set speed 1200
4063 C-Kermit>set modem att7300
4064 C-Kermit>dial (123) 555-1212
4065
4066 Or use /dev/ph1 for the second phone line. Control-C will terminate the
4067 dialer. The telephone line must be in the DATA state; C-Kermit will remind you
4068 of this if it finds the line in VOICE state.
4069
4070 Connecting via the RS232C serial port:
4071
4072 $ kermit
4073 C-Kermit>set line /dev/tty000
4074 C-Kermit>set speed 9600
4075 (start doing work...)
4076 (after exiting C-Kermit you may type:)
4077
4078 C-Kermit automatically handles disabling and enabling logins on the phone lines
4079 and RS-232 port.
4080
4081
4082 1.16. X.25 Support
4083
4084 This section applies only to UNIX C-Kermit on SUN computers that are attached
4085 to X.25 networks via the SunLink X.25 product.
4086
4087 To use an X.25 connection:
4088
4089 C-Kermit>set network x.25
4090 C-Kermit>set host aaaaaaa
4091 C-Kermit>connect
4092
4093 where aaaaaaa is the X.121 address of the host you wish to connect to. An
4094 X.121 address is a many-digit number consisting of a 4-digit DNIC (Data Network
4095 Identification Code) followed by an NTN (Network Terminal Number) up to 10
4096 digits in length, or a 3-digit DCC (Data Country Code) followed by a
4097 country-dependent NN (National Number) up to 11 digits in length.
4098
4099 The following connect-mode escapes apply to X.25 terminal connections:
4100
4101 Ctrl-\H
4102 Hangup - Close the X.25 network connection.
4103
4104
4105 Ctrl-\I
4106 Interrupt - Send an X.25 interrupt packet.
4107
4108
4109 Ctrl-\R
4110 Reset the X.25 virtual circuit.
4111
4112 The following special commands can be used to control your X.25 connection:
4113
4114 HANGUP
4115 Close the X.25 network connection.
4116
4117
4118 PAD CLEAR
4119 Clear the X.25 virtual circuit.
4120
4121
4122 PAD INTERRUPT
4123 Send an X.25 Interrupt packet.
4124
4125
4126 PAD RESET
4127 Reset the X.25 virtual circuit.
4128
4129
4130 PAD STATUS
4131 X.25 status request.
4132
4133
4134 SET PAD BREAK-ACTION n
4135 X.3 Parameter 7. What PAD should do if it receives a BREAK signal. 0 =
4136 nothing, 1 = send Interrupt packet, 2 = reset, 4 = send Indication Of Break
4137 PAD message, 8 = escape to PAD, 16 = discard output. Default = 21 (= 16 +
4138 4 + 1).
4139
4140
4141 SET PAD BREAK-CHARACTER n
4142 Default 0.
4143
4144
4145 SET PAD LINE-DELETE n
4146 X.3 Parameter 17. 0-127 = ASCII value of character to be used for erasing
4147 a line. Default = 21 (Ctrl-U).
4148
4149
4150 SET PAD CHARACTER-DELETE n
4151 X.3 Parameter 16. 0-127 = ASCII value of character to be used for erasing
4152 a character. Default = 8 (Ctrl-H = Backspace).
4153
4154
4155 SET PAD CR-PADDING n
4156 X.3 Parameter 9, Padding After Carriage Return (CR). 0-255. Number of
4157 padding characters PAD should send to DTE after sending a CR. Default = 0.
4158
4159
4160 SET PAD DISCARD-OUTPUT { 0, 1 }
4161 X.3 Parameter 8. 0 = normal data delivery, 1 = discard output. Default =
4162 0.
4163
4164
4165 SET PAD LINE-DISPLAY n
4166 X.3 Parameter 18. 0-127 = ASCII value of character to redisplay an edited
4167 line. Default = 18 (Ctrl-R).
4168
4169
4170 SET PAD ECHO { 0, 1 }
4171 X.3 Parameter 2. 0 = PAD will not echo, 1 = PAD will echo. Default = 1.
4172
4173
4174 SET PAD EDITING { 0, 1 }
4175 X.3 Parameter 15. 0 = No editing, 1 = editing allowed. Default = 1.
4176
4177
4178 SET PAD ESCAPE { 0, 1 }
4179 X.3 Parameter 1. 0 = Escape to PAD not possible, 1 = Ctrl-P escapes to
4180 PAD.
4181
4182
4183 SET PAD FORWARD n
4184 X.3 Parameter 3, Data Forwarding Characters. 0 = none, 1 = any
4185 alphanumeric, 2 = carriage return, etc. Default = 2.
4186
4187
4188 SET PAD LF-PADDING n
4189 X.3 Parameter 14. 0-255 padding characters to be sent by PAD after
4190 linefeed. Default = 0.
4191
4192
4193 SET PAD LF-INSERT n
4194 X.3 Parameter 13, Linefeed (LF) insertion after carriage return (CR). 0 =
4195 no LF insertion, 1 = PAD inserts LF after each CR sent to DTE, 2 = PAD
4196 inserts LF after each CR received from DTE, 4 = PAD echoes LF as CRLF.
4197 Default = 0.
4198
4199
4200 SET PAD LINE-FOLD n
4201 X.3 Parameter 10, Line Folding. 0 = none, 1-255 = number of graphic
4202 characters per line after which to insert folding characters. Default = 0.
4203
4204
4205 SET PAD PAD-FLOW-CONTROL { 0, 1 }
4206 X.3 Parameter 5. 0 = No flow control by PAD, 1 = PAD may send Xon/Xoff
4207 flow control to user. Default = 0.
4208
4209
4210 SET PAD SERVICE-SIGNALS { 0, 1 }
4211 X.3 parameter 6, PAD Service and Command Signals. 0 = PAD service signals
4212 are not sent to DTE, 1 = PAD service signals sent. Default = 1.
4213
4214
4215 SET PAD TIMEOUT n
4216 X.3 Parameter 4, Data forwarding timeout, 0-255 (twentieths of a second).
4217 Default = 0 (no data forwarding on timeout).
4218
4219
4220
4221
4222 SET PAD USER-FLOW-CONTROL { 0, 1 }
4223 X.3 Parameter 12. 0 = no flow control by user, 1 = user device may send
4224 Xon/Xoff flow control to PAD. Default = 0.
4225
4226
4227 SET X.25 CALL-USER-DATA { ON [ text ], OFF }
4228 OFF = no call user data, ON text sends the given text during call setup.
4229
4230
4231 SET X.25 CLOSED-USER-GROUP { OFF, ON n }
4232 OFF = no closed user group, ON n specifies the user group number, 0 to 99.
4233 OFF by default.
4234
4235
4236 SET X.25 REVERSE-CHARGE { OFF, ON }
4237 OFF = caller pays, ON = callee pays. Default is OFF.
4238
4239
4240 1.17. C-Kermit under VAX/VMS
4241
4242 This section contributed by Terry Kennedy, St. Peter's College, Jersey City,
4243 NJ, USA.
4244
4245
4246 1.17.1. File Transfer Issues
4247
4248 VMS provides a plethora of file formats, most of which have no direct
4249 equivalent on other operating systems (especially the other operating systems
4250 that C-Kermit runs under). Thus, the user is faced with the issue of file
4251 format conversion. VMS C-Kermit attempts to make this as painless as possible
4252 by mapping the various file formats to canonical form on transmission, and by
4253 creating the simplest file structure upon reception. Various C-Kermit commands
4254 may be used to give C-Kermit "hints" about what the user desires. Some of
4255 these work only when sending files, others only when receiving files. First,
4256 let's discuss some terms:
4257
4258 BINARY TRANSFER MODE (SET FILE TYPE BINARY)
4259
4260 When sending a file, C-Kermit/VMS reads bytes from the file and sends them
4261 without any kind of interpretation, translation, or reformatting. In
4262 particular, no characters are inserted at record boundaries.
4263
4264 When receiving files, C-Kermit/VMS collects bytes and writes them to disk at
4265 intervals. The file is created as "Fixed" organization, with the record size
4266 specifed by the user with SET FILE RECORD-LENGTH, or the default value of 512
4267 if the user does not override it. For both send and receive operations, the
4268 RMS attribute "First free byte" is used. Thus, VMS C-Kermit can operate on
4269 files where the file size (in bytes) is not an exact multiple of the file
4270 record size.
4271
4272 TEXT TRANSFER MODE (SET FILE TYPE TEXT)
4273
4274 When sending files, C-Kermit/VMS attempts to convert the file to a form which
4275 has the proper delimiters for "canonical Kermit protocol" form. Specifically,
4276 CR and LF characters are inserted as needed at the end of each record. This is
4277 normally an easy task, but is complicated by some VMS file types (such as the
4278 "Fortran carriage control" type). On reception, files are created as
4279 "Sequential variable, carriage return carriage control". C-Kermit uses a CR
4280 followed immediately by a LF as a record delimiter. Lone CR's or LF's are
4281 written as part of a record if they are present.
4282
4283 LABELED TRANSFER MODE (SET FILE TYPE LABELED)
4284
4285 When in this mode, C-Kermit/VMS gathers information about the file from various
4286 sources, such as the file's directory entry, ACL's, etc. and transmits it as
4287 part of the file data. This is called a LABELED FILE. Such files are not usable
4288 on non-VMS systems, but may be stored on such systems and later restored to
4289 another (or the same) VAX. An external utility named CKVCVT reconstitutes the
4290 file as it was, with various options.
4291
4292 Other systems should treat labeled files as simple files of TYPE BINARY.
4293
4294 Now, let's discuss the actions of sending or receiving:
4295
4296
4297 1.17.1.1. Sending Files from VMS C-Kermit
4298
4299 The requested file is opened and the VMS file characteristics are examined.
4300 Files of format "Undefined" or "Fixed" are sent as binary files, other formats
4301 are sent as text files.
4302
4303 SET FILE TYPE IMAGE. This forces the file to be sent as a stream of bytes,
4304 regardless of file characteristics, with a file type of binary declared in the
4305 attribute packet. This is useful for cases where other applications generate
4306 file contents with inappropriate file characteristics (for example, a stream-LF
4307 file which is actually binary data). This should only be used as a last
4308 resort, as [normally] RMS inserts bytes in the file for control purposes, and
4309 these bytes are transmitted (and misinterpreted by the receiving system).
4310
4311 SET FILE TYPE LABELED forces the file to be sent in labeled format, with
4312 C-Kermit reading the file from the disk as in IMAGE mode, and with a file type
4313 of binary declared in the attribute packet.
4314
4315
4316 1.17.1.2. Receiving Files to VMS C-Kermit
4317
4318 The characteristics supplied in the file's attribute packet are used to
4319 determine the desired file type. If no attribute packet arrives, the current
4320 SET FILE TYPE setting, TEXT or BINARY, is used. If the current file type is
4321 IMAGE, BINARY is used. SET FILE TYPE UNDEFINED forces the received file to be
4322 written with RMS RECORD FORMAT UNDEFINED for compatbility with some software
4323 that uses non-RMS routines for manipulating files. This option should normally
4324 not be used, as you will generate files VMS can't do anything with.
4325
4326 If the current FILE TYPE is LABELED, the incoming file is handled in LABELED
4327 mode if (a) its attribute packet declares its type to be binary, OR (b) there
4328 is no attribute packet. If the attribute packet says the file type is text,
4329 C-Kermit rejects the file. At the present time, C-Kermit does not understand
4330 received labeled files, and you should use the external CKVCVT utility to
4331 convert them.
4332
4333
4334 1.17.2. PRACTICAL APPLICATIONS
4335
4336 1.17.2.1. Between a VMS System and a Different System
4337
4338 The defaults should function properly, provided that the receiving system uses
4339 the "stream-of-bytes" philosophy of Unix. Extensive testing has been done
4340 between VMS C-Kermit and Unix C-Kermit, as well as MS-DOS Kermit. Other
4341 systems may require a re-thinking of the transfer strategy, but this author
4342 [tmk] considers it unlikely.
4343
4344
4345 1.17.2.2. Between VMS Systems
4346
4347 The goal of the defaults is to produce useful output in the majority of cases.
4348 If you need to transfer binary files where record boundaries are important and
4349 don't occur at fixed intervals (such as .OBJ files), or where the file
4350 semantics are extensive and not propagated by C-Kermit (such as DDIF files,
4351 indexed files, or files with extended semantics stored in an ACE, such as PCSA
4352 file service contents), you have two options.
4353
4354 1. SET FILE TYPE LABELED. Give this command to the sending C-Kermit
4355 system, receive the file on the target VMS system, and extract the
4356 contents with CKVCVT.
4357
4358 2. Encapsulate these files using VMS BACKUP, transfer the BACKUP
4359 saveset, and then restore it on the target system. BACKUP produces
4360 output files with a simple fixed length record structure. You
4361 should specify an explicit record size on the BACKUP command line
4362 such as:
4363
4364 BACKUP *.* FILES.BCK/SAVE_SET/RECORD=8192
4365
4366 and give the record size to the receiving Kermit with the command
4367 SET FILE RECORD-LENGTH before sending your saveset.
4368
4369
4370 1.17.3. Compatibility with Bliss-32 Kermit
4371
4372 Testing has shown that the two Kermits make similar assumptions about file
4373 characteristics. A variety of files were uploaded from MS-DOS to VMS with
4374 Bliss-32 Kermit, using a variety of transfer modes, and then returned to MS-DOS
4375 with C-Kermit and a byte-for-byte comparison was performed. The reverse
4376 operation was then tried and tested. No discrepancies were found. Although
4377 this does not guarantee 100% compatibility, it is very close. Equivalences:
4378
4379 C-Kermit/VMS Bliss Kermit-32
4380
4381 SET FILE TYPE TEXT SET FILE TYPE ASCII
4382 SET FILE TYPE BINARY [FIXED] SET FILE TYPE BINARY, SET FILE TYPE FIXED
4383 SET FILE TYPE BIN UNDEF (none)
4384 SET FILE TYPE IMAGE SET FILE TYPE BLOCK
4385 SET FILE TYPE LABELED (none)
4386
4387 Note: There is no distinction between SET FILE TYPE BINARY and FIXED in
4388 C-Kermit/VMS, and none is needed. C-Kermit determines the file type and length
4389 automatically when sending, and when receiving binary files, creates a
4390 fixed-format file and marks the true end using the "first free byte" mechanism
4391 of RMS. EXCEPT if you have given the command SET FILE TYPE BINARY UNDEFINED,
4392 in which case the file is stored with the RMS record format of UNDEFINED rather
4393 than fixed (but in the same format as a fixed file).
4394
4395
4396 1.17.4. Date and Time Attributes
4397
4398 The VMS C-Kermit server sends the file's creation date in the attribute packet
4399 when a file is sent. When receiving files, if there was valid date/time
4400 information in the attribute packet, C-Kermit will set the new file's creation
4401 date/time to the value provided. The file will be marked as being revised once
4402 (initial creation), on the current date/time. This is necessary to ensure that
4403 the file will be detected as "new" by VMS BACKUP. You should also note that if
4404 a file with a creation date in the future (as perceived by VMS) is received
4405 from a remote Kermit, the system will report "File has creation date in the
4406 future" to your system management if they use the ANALYZE/DISK command before
4407 the file's creation date has occured.
4408
4409 VMS C-Kermit has the command SET FILE COLLISION UPDATE, which can be used to
4410 reject files when there is a newer file than the incoming one with the same
4411 name. If you use this option, be aware that due to system clock skew, you may
4412 be able to send the file several times in succession before VMS C-kermit
4413 rejects it as [now] being older than the one on the VAX.
4414
4415
4416 1.17.5. File Size Attributes
4417
4418 When sending files, VMS C-Kermit fills in the file size information in the
4419 attribute packet. Note that the reported sizes may differ from the actual size
4420 due to insertion of CR/LF characters on transmission.
4421
4422 For received files, VMS C-Kermit checks checks for sufficient free disk space
4423 if the remote Kermit supplies file size information. If there isn't enough
4424 space on the disk, VMS C-Kermit will reject the file. Please note that user
4425 quotas are not checked. The logic to do so is quite complicated, and would lead
4426 to VMS C-Kermit rejecting files that could be received. As an example, consider
4427 a user with EXQUOTA privilege. In general, a file size rejection by VMS
4428 C-Kermit means the file will not fit; the lack of a rejection does not
4429 guarantee that the file will fit. Consider a small file being received onto an
4430 RX50 floppy. If debugging is turned on, the debug output will fill the floppy
4431 before the file is completely received.
4432
4433 If the device for the received file is not a disk (for example, the system
4434 lineprinter) the file is assumed to always fit.
4435
4436
4437 1.17.6. SET FILE TYPE LABELED
4438
4439 Labeled files contain various pieces of information needed to reconstruct the
4440 file. At the moment, this is handled by an external utility known as CKVCVT.
4441 Some items are always restored and other are not restored unless the user
4442 explicitly asks for them. File characteristics are always restored. The file
4443 name is restored (de-truncated). However, the complete directory specification
4444 is not used to recreate the file unless explicitly requested. This means that
4445 converted files will normally be restored to your current directory. Similarly,
4446 file ownership is assigned to you unless you specify that the original owner be
4447 retained. Note that the two previous options will require privileges. The file
4448 backup date is normally cleared so that the file will be backed up. This action
4449 may be overridden.
4450
4451 File ACE's are normally not restored. This is an all-or-nothing operation, as
4452 there are many types of ACE's under VMS. The most common usage of an ACE is to
4453 grant/deny file access to other users. However, various other uses exist. Some
4454 examples are: RMS Journaling, RMS Statistics, DDIF, and Pathworks. Note that
4455 ACE's are transported in binary mode, which means that protection ACE's may
4456 wind up applying to incorrect users if you move files between different VMS
4457 systems with ACE's enabled. Also, note that you can create ACE's which you
4458 cannot see with DIR/FULL unless you have SECURITY privilege. However, you
4459 should be able to view (but not modify) them with EDIT/ACL. This also means
4460 that you will not be able to delete these ACE's without deleting the file,
4461 which is another reason they are normally not restored.
4462
4463 RMS Journaling files are a special case. Journaling will not be enabled for a
4464 received labeled file. A DIR/FULL will show the journaling ACE, which you can
4465 use to determine the correct journaling paramters if you wish to journal the
4466 new file. Note that if you restore the file to another disk (even if it is on
4467 the same system) the journaling information will display incorrectly. This is
4468 a limit of the DEC RMS Journaling product.
4469
4470
4471 1.17.7. Reporting Problems
4472
4473 If you have a file that does not transfer correctly, or that exhibits a problem
4474 when moved one way with Bliss-32 Kermit and the back with C-Kermit, we would be
4475 interested in seeing it (especially if it's small 8-). Please make a BACKUP
4476 saveset of it under VMS, and send the saveset along to the BUGS address (use
4477 the command BUG in C-Kermit for up-to-date information). Please include any
4478 specific information you think would be useful. As a bare minimum, please give
4479 the Kermit version number(s), the VMS version, and the compiler version (if you
4480 re-compiled Kermit).
4481
4482
4483 1.17.8. Sections that need to be added
4484
4485 Hints for users and system managers on configuring their VMS system and
4486 terminal devices for best use with Kermit -- BYTLM quotas, Alt-typahead
4487 buffers, etc etc. What are the sysgen options, what SET TERMINAL commands (if
4488 any) should be used before running C-Kermit, etc...