Temporarily use -O1 until segfault with -O2+krb5+iksd is fixed
[ckermit.git] / ckcbwr.txt
1
2    [1]The Columbia Crown The Kermit Project | Columbia University
3    612 West 115th Street, New York NY 10025 USA o [2]kermit@columbia.edu
4    ...since 1981
5    [3]Home [4]Kermit 95 [5]C-Kermit [6]Scripts [7]Current [8]New [9]FAQ
6    [10]Support
7
8    As of: C-Kermit 9.0.300, 30 June 2011
9    This page last updated: Tue Jun 28 08:54:30 2011 (New York USA Time)
10
11      IF YOU ARE READING A PLAIN-TEXT version of this document, it is a
12      plain-text dump of a Web page. You can visit the original (and
13      possibly more up-to-date) Web page here:
14
15   [11]http://www.columbia.edu/kermit/ckcbwr.html
16
17    This document contains platform-independent C-Kermit hints and tips.
18    Also see the platform-specific C-Kermit hints and tips document for
19    your platform, for example:
20
21   [12]http://www.columbia.edu/kermit/ckubwr.html
22
23    for Unix. This document also applies to [13]Kermit 95 for Windows,
24    which is based on C-Kermit.
25
26    [ [14]C-Kermit ] [ [15]TUTORIAL ]
27
28 CONTENTS
29
30    0. [16]PATCHES
31    1. [17]INCOMPATIBLE CHANGES
32    2. [18]THE C-KERMIT COMMAND PARSER
33    3. [19]MULTIPLE SESSIONS
34    4. [20]NETWORK CONNECTIONS
35    5. [21]MODEMS AND DIALING
36    6. [22]DIALING HINTS AND TIPS
37    7. [23]TERMINAL SERVERS
38    8. [24]TERMINAL EMULATION
39    9. [25]KEY MAPPING
40   10. [26]FILE TRANSFER
41   11. [27]SCRIPT PROGRAMMING
42
43 0. PATCHES
44
45    [ [28]Top ] [ [29]Contents ] [ [30]Next ]
46
47    Source-level patches for C-Kermit 8.0.211:
48
49      (None)
50
51 1. INCOMPATIBLE CHANGES
52
53    [ [31]Top ] [ [32]Contents ] [ [33]Next ]
54
55    These are not necessarily exhaustive lists.
56
57 1.1. C-Kermit 6.0
58
59    C-Kermit 6.0 was released 6 September 1996 and is completely documented
60    in [34]Using C-Kermit, 2nd Edition. The following incompatible changes
61    were made in C-Kermit 6.0:
62
63      * Unless you tell C-Kermit otherwise, if a serial or network
64        connection seems to be open, and you attempt to EXIT or to open a
65        new connection, C-Kermit warns you that an active connection
66        appears to be open and asks you if you really want to close it. If
67        you do not want these warnings, add SET EXIT WARNING OFF to your
68        customization file or script, or give this command at the prompt.
69      * The default for SET { SEND, RECEIVE } PATHNAMES was changed from ON
70        to OFF, to prevent unexpected creation of directories and
71        depositing of incoming files in places you might not know to look.
72      * The default for SET FILE INCOMPLETE was changed from DISCARD to
73        KEEP to allow for file transfer recovery.
74      * The default file-transfer block-check is now 3, rather than 1. If
75        the other Kermit does not support this, the two will drop back to
76        type 1 automatically unless the other Kermit fails to follow the
77        protocol specification.
78      * The default flow-control is now "auto" ("do the right thing for
79        each type of connection"), not Xon/Xoff.
80      * Backslash (\) is no longer a command continuation character. Only -
81        (hyphen, dash) may be used for this in C-Kermit 6.0 and later.
82      * Negative INPUT timeout now results in infinite wait, rather than 1
83        second.
84
85 1.2. C-Kermit 7.0
86
87    C-Kermit 7.0 was released 1 January 2000. Its new features are
88    documented in the C-Kermit 7.0 Supplement,
89    [35]http://www.columbia.edu/kermit/ckermit2.html. The following
90    incompatible changes were made in C-Kermit 7.0:
91      * The "multiline GET" command is gone. Now use either of the
92        following forms instead:
93   get remote-name local-name
94   get /as-name:local-name remote-name
95
96        If either name contains spaces, enclose it in braces (or, in
97        C-Kermit 8.0, doublequotes).
98      * To include multiple file specifications in a GET command, you must
99        now use MGET rather than GET:
100   mget file1 file2 file3 ...
101
102      * C-Kermit 7.0 and later use FAST Kermit protocol settings by
103        default. This includes "unprefixing" of certain control characters.
104        Because of this, file transfers that worked with previous releases
105        might not work in the new release especially against a
106        non-Kermit-Project Kermit protocol implementation (but it is more
107        likely that they will work, and much faster). If a transfer fails,
108        you'll get a context-sensitive hint suggesting possible causes and
109        cures. Usually SET PREFIXING ALL does the trick.
110      * By default C-Kermit 7.0 and later send files in text or binary mode
111        by looking at each file to see which is the appropriate mode. To
112        restore the previous behavior, put SET TRANSFER MODE MANUAL and the
113        desired SET FILE TYPE (TEXT or BINARY) in your C-Kermit
114        initialization file.
115      * The RESEND and REGET commands automatically switch to binary mode;
116        previously if RESEND or REGET were attempted when FILE TYPE was
117        TEXT, these commands would fail immediately, with a message telling
118        you they work only when the FILE TYPE is BINARY. Now they simply do
119        this for you.
120      * SET PREFIXING CAUTIOUS and MINIMAL now both prefix linefeed (10 and
121        138) in case rlogin, ssh, or cu are "in the middle", since
122        otherwise <LF>~ might appear in Kermit packets, and this would
123        cause rlogin, ssh, or cu to disconnect, suspend,escape back, or
124        otherwise wreck the file transfer. Xon and Xoff are now always
125        prefixed too, even when Xon/Xoff flow control is not in effect,
126        since unprefixing them has proven dangerous on TCP/IP connections.
127      * In UNIX, VMS, Windows, and OS/2, the DIRECTORY command is built
128        into C-Kermit itself rather than implemented by running an external
129        command or program. The built-in command might not behave the way
130        the platform-specific external one did, but many options are
131        available for customization. Of course the underlying
132        platform-specific command can still be accessed with "!", "@", or
133        "RUN" wherever the installation does not forbid. In UNIX, the "ls"
134        command can be accessed directly as "ls" in C-Kermit.
135      * SEND ? prints a list of switches rather than a list of filenames.
136        If you want to see a list of filenames, use a (system-dependent)
137        construction such as SEND ./? (for UNIX, Windows, or OS/2), SEND
138        []? (VMS), etc.
139      * In UNIX, OS-9, and Kermit 95, the wildcard characters in previous
140        versions were * and ?. In C-Kermit 7.0 they are *, ?, [, ], {, and
141        }, with dash used inside []'s to denote ranges and comma used
142        inside {} to separate list elements. If you need to include any of
143        these characters literally in a filename, precede each one with
144        backslash (\).
145      * SET QUIET { ON, OFF } is now on the command stack, just like SET
146        INPUT CASE, SET COUNT, SET MACRO ERROR, etc, as described on p.458
147        of [36]Using C-Kermit, 2nd Edition. This allows any macro or
148        command file to SET QUIET ON or OFF without worrying about saving
149        and restoring the global QUIET value. For example, this lets you
150        write a script that tries SET LINE on lots of devices until it
151        finds one free without spewing out loads of error messages, and
152        also without disturbing the global QUIET setting, whatever it was.
153      * Because of the new "." operator (which introduces assignments),
154        macros whose names begin with "." can not be invoked "by name".
155        However, they still can be invoked with DO or \fexecute().
156      * The syntax of the EVALUATE command has changed. To restore the
157        previous syntax, use SET EVALUATE OLD.
158      * The \v(directory) variable now includes the trailing directory
159        separator; in previous releases it did not. This is to allow
160        constructions such as:
161   cd \v(dir)data.tmp
162
163        to work across platforms that might have different directory
164        notation, such as UNIX, Windows, and VMS.
165      * Prior to C-Kermit 7.0, the FLOW-CONTROL setting was global and
166        sticky. In C-Kermit 7.0, there is an array of default flow-control
167        values for each kind of connection, that are applied automatically
168        at SET LINE/PORT/HOST time. Thus a SET FLOW command given before
169        SET LINE/PORT/HOST is likely to be undone. Therefore SET FLOW can
170        be guaranteed to have the desired effect only if given after the
171        SET LINE/PORT/HOST command.
172      * Character-set translation works differently in the TRANSMIT command
173        when (a) the file character-set is not the same as the local end of
174        the terminal character-set, or (b) when the terminal character-set
175        is TRANSPARENT.
176
177 1.3. C-Kermit 8.0
178
179    The following incompatible changes were made in C-Kermit 8.0:
180      * C-Kermit now accepts doublequotes in most contexts where you
181        previously had to use braces to group multiple words into a single
182        field, or to force inclusion of leading or trailing blanks. This
183        might cause problems in contexts where you wanted the doublequote
184        characters to be taken literally. Consult [37]Section 5 of the
185        [38]C-Kermit 8.0 Update Notes for further information.
186      * Using the SET HOST command to make HTTP connections is no longer
187        supported. Instead, use the new [39]HTTP OPEN command.
188
189 1.4. C-Kermit 9.0
190
191    The [40]\fsplit() function is incredibly handy, it can do almost
192    anything, up to and including parsing a LISP program (the underlying
193    code is the basis of the [41]S-Expression interpreter). But did you
194    ever try to use it to parse (say) a Tab-Separated-List (TSV file) or
195    Comma-Separated-List (CSV)? It works as expected as long as the data
196    contains only 7-bit characters. But if your data contains (say) Spanish
197    or German or Russian text written in an 8-bit character set such as ISO
198    8859-1, every 8-bit character (any value 128-255) is treated as a break
199    character. This is fixed in C-Kermit 9.0 by treating all 8-bit bytes as
200    "include" characters rather than break characters, a total reversal of
201    past behavior. I don't think it will affect anyone though, because if
202    this had happened to anyone, I would have heard about it!
203
204    Since most standard 8-bit character sets have control characters in
205    positions 128-160, it might have made sense to keep 128-160 in the
206    break set, but with the proliferation of Microsoft Windows code pages,
207    there is no telling which 8-bit character is likely to be some kind of
208    text, e.g. "smart quotes" or East European or Turkish accented letters.
209
210 2. THE C-KERMIT COMMAND PARSER
211
212    [ [42]Top ] [ [43]Contents ] [ [44]Next ] [ [45]Previous ]
213
214    Various command-related limits are shown in the following table, in
215    which the sample values are for a "large memory model" build of
216    C-Kermit, typical for modern platforms (Linux, Solaris, AIX, VMS, etc).
217    You can see the values for your version of Kermit by giving the SHOW
218    FEATURES command. The maximum length for a Kermit command (CMDBL) also
219    determines the maximum length for a macro definition, since DEFINE is
220    itself a command. The maximum length for a variable name is between 256
221    and 4096 characters, depending on the platform; for array declarations
222    and references, that includes the subscript.
223
224    Item Symbol Sample
225    Value Definition
226    Number of characters in a command CMDBL 32763 ckucmd.h
227    Number of chars in a field of a command    ATMBL 10238 ckucmd.h
228    Nesting level for command files MAXTAKE 54   ckuusr.h
229    Nesting level for macros MACLEVEL 128 ckuusr.h
230    Nesting level for FOR / WHILE loops FORDEPTH 32 ckuusr.h
231    Number of macros MAC_MAX 16384 ckuusr.h
232    Size of INPUT buffer INPBUFSIZ 4096 ckuusr.h
233    Maximum files to match a wildcard MAXWLD    102400 ckcdeb.h
234    Filespecs in MSEND command MSENDMAX 1024 ckuusr.h
235    Length for GOTO target label LBLSIZ 50 ckuusr.h
236    \fexecute() recursion depth limit CMDDEP 64 ckucmd.h
237
238    If you need to define a macro that is longer than CMDBL, you can break
239    the macro up into sub-macros or rewrite the macro as a command file. In
240    a pinch you can also redefine CMDBL and recompile C-Kermit. All of
241    these numbers represent tradeoffs: the bigger the number, the more
242    "powerful" Kermit in the corresponding area, but also the bigger the
243    program image and possibly disk footprint, and the longer it takes to
244    load and initialize.
245
246    In the interactive command parser:
247
248      * EMACS- or VI-style command line editing is not supported.
249      * Editing keys are hardwired (Ctrl-U, Ctrl-W, etc).
250
251    If you interrupt C-Kermit before it has issued its first prompt, it
252    will exit. This means that you cannot interrupt execution of the
253    initialization file, or of an "application file" (file whose name is
254    given as the first command-line argument), or of an alternative
255    initialization file ("-y filename"), and get to the prompt. There is,
256    however, one exception to this rule: you *can* interrupt commands --
257    including TAKE commands -- given in the '-C "command list"'
258    command-line argument and -- if there were no action commands among the
259    command-line arguments -- you will be returned to the C-Kermit prompt.
260    So, for example, if you want to start C-Kermit in such a way that it
261    executes a command file before issuing its first prompt, and you also
262    want to be able to interrupt the command file and get to the prompt,
263    include a TAKE command for the desired command in the -C argument, for
264    example:
265
266   kermit -C "take dial.scr"
267
268    At the command prompt, if you use the backslash (\) prefix to enter a
269    control character, space, or question mark into a command literally,
270    the backslash disappears and is replaced by the quoted character. If it
271    was a control character, it is shown as a circumflex (^). This allows
272    editing (backspace, delete, Ctrl-W) to work correctly even for control
273    characters.
274
275    Priot to C-Kermit 8.0, the only way to include a comma literally in a
276    macro definition -- as opposed to having it separate commands within
277    the definition -- is to enter its ASCII value (44) in backslash
278    notation, e.g.:
279
280   DEFINE ROWS RUN MODE CO80\{44}\%1
281
282    In C-Kermit 8.0 you can use constructions like this:
283
284   DEFINE ROWS RUN MODE "CO80,\%1"
285
286    If you quote special characters in a filename (e.g. in the SEND
287    command), filename completion may seem to work incorrectly. For
288    example, if you have a file whose name is a*b (the name really contains
289    an asterisk), and you type "send a\\*<ESC>", the "b" does not appear,
290    nor will Ctrl-R redisplay the completed name correctly. But internally
291    the file name is recognized anyway.
292
293    Question-mark help does not work during execution of an ASKQ command.
294    The question marks are simply accepted as text.
295
296    In OUTPUT commands only, \B sends a BREAK signal, \L sends a Long BREAK
297    signal, and \N sends a NUL (ASCII 0). BREAK and Long BREAK are special
298    signals, not characters, and NUL is a character that normally cannot be
299    included in a C string, since it is the C string terminator. If you
300    really want to output a backslash followed by a B, an L, or an N (as is
301    needed to configure certain modems, etc), double the backslash, e.g.
302    "output \\B". In C-Kermit 7.0 or later, you can disarm and re-arm the
303    special OUTPUT-command escapes (\B, \L, and \N) with SET OUTPUT
304    SPECIAL-ESCAPES { OFF, ON }.
305
306    When using the command-line processor ("kermit -l /dev/tty00 -b 19200",
307    etc), note that in some cases the order of the command-line options
308    makes a difference, contrary to the expectation that order of
309    command-line options should not matter. For example, the -b option must
310    be given after the -l option if it is to affect the device specified in
311    the -l option.
312
313 3. MULTIPLE SESSIONS
314
315    [ [46]Top ] [ [47]Contents ] [ [48]Next ] [ [49]Previous ]
316
317    C-Kermit 7.0 and earlier do not support multiple sessions. When you SET
318    LINE (or SET PORT, same thing) to a new device, or SET HOST to a new
319    host, the previous SET LINE device or network host connection is
320    closed, resulting in hangup of the modem or termination of the network
321    connection. In windowing environments like HP-VUE, NeXTSTEP, Windows,
322    OS/2, etc, you can run separate copies of Kermit in different windows
323    to achieve multiple sessions.
324
325    To achieve multiple sessions through a single serial port (e.g. when
326    dialing up), you can install SLIP or PPP on your computer and then use
327    C-Kermit's TCP/IP support over the SLIP or PPP connection, assuming you
328    also have TCP/IP networking installed on your computer.
329
330    C-Kermit 8.0 has the same restriction on SET LINE and SET HOST
331    sessions: only one regular session (dialout, Telnet, etc) can be open
332    at a time. However, version 8.0 adds two new kinds of sessions: FTP and
333    HTTP; one or both of these can be open at the same as a regular
334    session.
335
336 4. NETWORK CONNECTIONS
337
338    [ [50]Top ] [ [51]Contents ] [ [52]Next ] [ [53]Previous ]
339
340 FTP Client Bugs
341
342    The Unix C-Kermit 8.0.206 FTP client had the following bugs at the time
343    most of the 8.0.206 binaries were built for the C-Kermit 8.0 CDROM:
344
345     1. FTP MGET fails when directory segments contain wildcards, as in
346        "ftp mget */data/*.dat". Work around by doing a separate MGET for
347        each source directory.
348     2. FTP MGET can fail or produce random side effects if you have a
349        TMPDIR or CK_TMP environment variable definition in effect, or a
350        SET TEMP-DIRECTORY value, longer than 7 characters. Work around by
351        giving a SET TEMP-DIRECTORY command with a short value, such as
352        "/tmp".
353
354    These two bugs are fixed in the source code that is included on the
355    CDROM, and also in Kermit 95 2.1.1. You can tell if a C-Kermit 8.0.206
356    binary has these fixes by typing SHOW VERSION; if it says "FTP Client,
357    8.0.200, 24 Oct 2002" it has the fixes; if the edit number is less that
358    200, it doesn't, in which case can build a new binary from the source
359    code (or contact us and we'll try to get get one for you).
360
361 Making TCP/IP Connections Can Take a Long Time
362
363    The most frequently asked question in many newsgroups is "Why does it
364    take such a long time to make a Telnet connection to (or from) my
365    (e.g.) Linux PC?" (this applies to Kermit as well as to regular Telnet
366    clients):
367
368     1. Most Telnet servers perform reverse DNS lookups on the client for
369        security and/or logging reasons. If the Telnet client's host cannot
370        be found by the server's local DNS server, the DNS request goes out
371        to the Internet at large, and this can take quite some time. The
372        solution to this problem is to make sure that both client and host
373        are registered in DNS.
374     2. C-Kermit itself performs reverse DNS lookups unless you tell it not
375        to. This is to allow C-Kermit to let you know which host it is
376        actually connected to in case you have made a connection to a "host
377        pool" (multihomed host). You can disable C-Kermit's reverse DNS
378        lookup with SET TCP REVERSE-DNS-LOOKUP OFF.
379     3. C-Kermit 7.0 and later strictly enforce Telnet protocol rules. One
380        such rule is that certain negotiations must be responded to. If
381        C-Kermit sends a such a negotiation and the host does not respond,
382        C-Kermit waits a long time for the reply (in case the network is
383        congested or the host is slow), but eventually will time out. To
384        eliminate the waits (and therefore risk possible protocol
385        mismatches -- or worse -- between Telnet client and server), tell
386        C-Kermit to SET TELNET WAIT OFF (or include the /NOWAIT switch with
387        the TELNET command).
388
389 The Rlogin Client
390
391    In multiuser operating systems such as UNIX and VMS, TCP/IP Rlogin
392    connections are available only to privileged users, since "login" is a
393    privileged socket. Assuming you are allowed to use it in the first
394    place, it is likely to behave differently depending on what type of
395    host you are rlogging in to, due to technical reasons having to do with
396    conflicting interpretations of RFC793 (Out-Of-Band Data) and Rlogin
397    (RFC1122)... "Specifically, the TCP urgent pointer in BSD points to the
398    byte after the urgent data byte, and an RFC-compliant TCP urgent
399    pointer points to the urgent data byte. As a result, if an application
400    sends urgent data from a BSD-compatible implementation to an
401    [54]RFC-1122 compatible implementation then the receiver will read the
402    wrong urgent data byte (it will read the byte located after the correct
403    byte in the data stream as the urgent data byte)." Rlogin requires the
404    use of OOB data while Telnet does not. Therefore, it is possible for
405    Telnet to work between all systems while BSD and System V TCP/IP
406    implementations are almost always a bad mix.
407
408 The Telnet Client
409
410    On a TCP/IP TELNET connection, you should normally have PARITY set to
411    NONE and (except in VMS C-Kermit) FLOW-CONTROL also set to NONE. If
412    file transfer does not work with these settings (for example, because
413    the remote TELNET server only gives a 7-bit data path), use SET PARITY
414    SPACE. Do not use SET PARITY MARK, EVEN, or ODD on a TELNET connection
415    -- it interferes with TELNET protocol.
416
417    If echoing does not work right after connecting to a network host or
418    after dialing through a TCP/IP modem server, it probably means that the
419    TELNET server on the far end of the connection is executing the TELNET
420    protocol incorrectly. After initially connecting and discovering
421    incorrect echoing (characters are echoed twice, or not at all), escape
422    back, give the appropriate SET DUPLEX command (FULL or HALF), and then
423    CONNECT again. For a consistently misbehaving connection, you can
424    automate this process in a macro or TAKE file.
425
426    TELNET sessions are treated just like serial communications sessions as
427    far as "terminal bytesize" and "command bytesize" are concerned. If you
428    need to view and/or enter 8-bit characters during a TELNET session, you
429    must tell C-Kermit to SET TERMINAL BYTESIZE 8, SET COMMAND BYTESIZE 8,
430    and SET PARITY NONE.
431
432    If you SET TELNET DEBUG ON prior to making a connection, protocol
433    negotiations will be displayed on your screen. You can also capture
434    them in the debug log (along with everything else) and then extract
435    them easily, since all Telnet negotiations lines begin with (uppercase)
436    "TELNET".
437
438 5. MODEMS AND DIALING
439
440    [ [55]Top ] [ [56]Contents ] [ [57]Next ] [ [58]Previous ]
441
442    External modems are recommended because:
443
444      * They don't need any special drivers.
445      * They are less likely to interfere with normal operation of your
446        computer.
447      * You can use the lights and speaker to troubleshoot dialing.
448      * You can share them among all types of computers.
449      * You can easily turn them off and on when power-cycling seems
450        warranted.
451      * They are more likely to have manuals.
452
453    Modems can be used by C-Kermit only when they are visible as or through
454    a regular serial port device. Certain modems can not be used in this
455    normal way on many kinds of computers: Winmodems, RPI modems,
456    Controllerless modems, the IBM Mwave, etc; all of these require special
457    drivers that perform some, most, or all of the modem's functions in
458    software. Such drivers are generally NOT available in UNIX or other
459    non-Windows (or non-OS/2, in the case of the Mwave) platforms.
460
461    In order to dial a modem, C-Kermit must know its repertoire of commands
462    and responses. Each modem make and model is likely to have a different
463    repertoire. Since Kermit has no way of knowhing which kind of modem
464    will be dialed, normally you have to tell it with a SET MODEM TYPE
465    command, e.g.:
466
467   set modem type usrobotics
468   set line /dev/cua0
469   set speed 57600
470   dial 7654321
471
472    In the early days, there was a wide variety of modems and command
473    languages. Nowadays, almost every modem uses the Hayes AT command set
474    (but with some differences in the details) and its startup
475    configuration includes error correction, data compression, and hardware
476    (RTS/CTS) flow control. As long as C-Kermit is capable of hardware flow
477    control (as it is on many, but not all, the platforms where it runs,
478    since some operating systems don't support it), the modem can be dailed
479    immediately, without lengthy configuration dialogs, and in fact this is
480    what SET MODEM TYPE GENERIC-HIGH-SPEED does. In C-Kermit 8.0,
481    GENERIC-HIGH-SPEED has become the default modem type, so now it is
482    usually possible to SET LINE, SET SPEED, and DIAL without having to
483    identify your modem. If this doesn't work, of course, then you might
484    have to fall back to the tradiational method: Give a SET MODEM TYPE for
485    a specific modem first, then SET LINE, SET SPEED, and DIAL.
486
487    An important change in C-Kermit 6.0 is that when you give a SET MODEM
488    TYPE command to tell Kermit what kind of modem you have, Kermit also
489    sets a number of other modem-related parameters automatically from its
490    internal modem database. Thus, the order in which you give
491    modem-related commands is significant, whereas in prior releases they
492    could be given in any order.
493
494    In particular, MODEM SPEED-MATCHING is set according to whether the
495    modem is known to be capable of speed buffering. SET MODEM TYPE
496    HAYES-2400 automatically turns SPEED-MATCHING ON, because when the
497    Hayes 2400 reports a particular speed in its CONNECT message, that
498    means its interface speed has changed to that speed, and C-Kermit's
499    must change accordingly if it is to continue communicating. This might
500    cause some confusion if you use "set modem type hayes" for dialing a
501    more advanced type of modem.
502
503    The new default for flow control is "auto", meaning "do the right thing
504    for each type of connection". So (for example) if your version of
505    C-Kermit supports SET FLOW RTS/CTS and your modem also supports
506    RTS/CTS, then Kermit automatically sets its flow control to RTS/CTS and
507    set modem's flow control to RTS/CTS too before attempting to use the
508    modem.
509
510    For these reasons, don't assume that "set modem type hayes" should be
511    used for all modems that uses the Hayes AT command set. "set modem type
512    hayes" really does mean Hayes 1200 or 2400, which in turn means no
513    hardware flow control, and no speed buffering. This choice will rarely
514    work with a modern high-speed modem.
515
516 6. DIALING HINTS AND TIPS
517
518    [ [59]Top ] [ [60]Contents ] [ [61]Next ] [ [62]Previous ]
519
520    If you have a high-speed, error-correcting, data-compressing,
521    speed-buffering modem, you should fix the modem's interface speed as
522    high as possible, preferably (at least) four times higher than its
523    maximum connection (modulation) speed to allow compression to work at
524    full advantage. In this type of setup, you must also have an effective
525    means of flow control enabled between C-Kermit and the modem,
526    preferably hardware (RTS/CTS) flow control. On platforms that do not
527    support hardware flow control, it is usually possible to select
528    software flow control (Xon/Xoff), and C-Kermit will do its best to set
529    the modem for local Xon/Xoff flow control too (but then, of course,
530    Ctrl-S and Ctrl-Q characters can not be transmitted on the connection).
531
532    If you are having trouble dialing your modem, SET DIAL DISPLAY ON to
533    watch the dialing interactions between C-Kermit and your modem. Consult
534    Chapters 3-4 of [63]Using C-Kermit (2nd Ed) for modem-dialing
535    troubleshooting instructions. The following sections offer some
536    addtional hints and tips.
537
538 6.1. Syntax
539
540    If you want to dial a number that starts with #, you'll need to quote
541    the "#" character (as \# or \{35}), since it is also a comment
542    introducer:
543
544   C-Kermit>dial #98765421-1-212-5551212   ; Looks like a comment
545   ?You must specify a number to dial
546   C-Kermit>dial \#98765421-1-212-5551212  ; Works OK
547   C-Kermit>dial =#98765421-1-212-5551212  ; This works too
548
549    When using a dialing directory, remember what happens if a name is not
550    found:
551
552   C-Kermit>dial xyzcorp
553   Lookup: "xyzcorp" - not found - dialing as given
554
555    This normally does no harm, but some modems might behave strangely when
556    given dial strings that contain certain letters. For example, a certain
557    German modem treats any dial string that contains the letter "s" as a
558    command to fetch a number from its internal list, and replies OK to the
559    ATD command, which is normally not a valid response except for partial
560    dialing. To avoid this situation, use:
561
562   lookup xyzcorp
563   if success dial
564
565 6.2. The Carrier Signal
566
567    Remember: In many C-Kermit implementations (depending on the underlying
568    operating system -- mostly Windows, OS/2, and System-V-based UNIX
569    versions, and in C-Kermit 7.0, also VMS), you can't CONNECT to a modem
570    and type the modem's dialing command (like "ATDT7654321") manually,
571    unless you first tell C-Kermit to:
572
573   SET CARRIER-WATCH OFF
574
575    This is because (in these implementations), the CONNECT command
576    requires the modem's Carrier Detect (CD) signal to be on, but the CD
577    signal doesn't come on until after dialing is complete. This
578    requirement is what allows C-Kermit to pop back to its prompt
579    automatically when the connection is hung up. See the description of
580    SET CARRIER-WATCH in "Using C-Kermit".
581
582    Similarly, if your dialed connection drops when CARRIER-WATCH is set to
583    AUTO or ON, you can't CONNECT back to the (now disconnected) screen to
584    see what might have happened unless you first SET CARRIER-WATCH OFF.
585    But sometimes not even SET CARRIER-WATCH OFF will help in this
586    situation: certain platforms (for example Unixware 2.1), once carrier
587    drops, won't let the application do i/o with the device any more. In
588    that case, if you want to use the device again, you have to CLOSE it
589    and OPEN it again. Or you can have Kermit do this for you automatically
590    by telling it to SET CLOSE-ON-DISCONNECT ON.
591
592 6.3. Dialing and Flow Control
593
594    Don't SET FLOW RTS/CTS if your modem is turned off, or if it is not
595    presenting the CTS signal. Otherwise, the serial device driver can get
596    stuck waiting for this signal to appear.
597
598    Most modern modems support RTS/CTS (if they support any hardware flow
599    control at all), but some computers use different RS-232 circuits for
600    the same purposes, e.g. DTR and CD, or DTR and CTS. In such cases, you
601    might be able to make your computer work with your modem by
602    appropriately cross-wiring the circuits in the cable connector, for
603    example the computer's DTR to the modem's RTS, and modem's CD to the
604    computer's CTS. HOWEVER, C-Kermit does not know you have done this. So
605    if you have (say) SET FLOW DTR/CD, C-Kermit will make no attempt to
606    tell the modem to use RTS/CTS. You probably did this yourself when you
607    configured the modem.
608
609 6.4. The Dial Timeout
610
611    If it takes your call longer to be completed than the timeout interval
612    that C-Kermit calculates, you can use the SET DIAL TIMEOUT command to
613    override C-Kermit's value. But beware: the modem has its own timeout
614    for completing the call. If it is a Hayes-like modem, C-Kermit adjusts
615    the modem's value too by setting register S7. But the maximum value for
616    S7 might be smaller than the time you need! In that case, C-Kermit sets
617    S7 to 0, 255, or other (modem-specific) value to signify "no timeout".
618    If Kermit attempts to set register S7 to a value higher than your
619    modem's maximum, the modem will say "ERROR" and you will get a "Failure
620    to initialize modem" error. In that case, use SET DIAL TIMEOUT to
621    override C-Kermit's calculation of the timeout value with the highest
622    value that is legal for your modem, e.g. 60.
623
624 6.5. Escape Sequence Guard Time
625
626    A "TIES" (Time-Independent Escape Sequence) modem does not require any
627    guard time around its escape sequence. The following text:
628
629   +++ATH0
630
631    if sent through a TIES modem, for example because you were uploading
632    this file through it, could pop the modem back into command mode and
633    make it hang up the connection. Later versions of the Telebit T1600 and
634    T3000 (version LA3.01E firmware and later), and all WorldBlazers, use
635    TIES.
636
637    Although the probability of "+++" appearing in a Kermit packet is
638    markedly lower than with most other protocols (see the [64]File
639    Transfer section below), it can still happen under certain
640    circumstances. It can also happen when using C-Kermit's TRANSMIT
641    command. If you are using a Telebit TIES modem, you can change the
642    modem's escape sequence to an otherwise little-used control character
643    such as Ctrl-_ (Control-Underscore):
644
645   AT S2=31
646
647    A sequence of three consecutive Ctrl-_ characters will not appear in a
648    Kermit packet unless you go to extraordinary lengths to defeat more
649    than a few of Kermit's built-in safety mechanisms. And if you do this,
650    then you should also turn off the modem's escape-sequence recognition
651    altogether:
652
653   AT S48=0 S2=255
654
655    But when escape sequence recognition is turned off, "modem hangup"
656    (<pause>+++<pause>ATH0<CR>) will not work, so you should also SET MODEM
657    HANGUP RS232-SIGNAL (rather then MODEM-COMMAND).
658
659 6.6. Adaptive Dialing
660
661    Some modems have a feature called adaptive dialing. When they are told
662    to dial a number using Tone dialing, they check to make sure that
663    dialtone has gone away after dialing the first digit. If it has not,
664    the modem assumes the phone line does not accept Tone dialing and so
665    switches to Pulse. When dialing out from a PBX, there is almost always
666    a secondary dialtone. Typically you take the phone off-hook, get the
667    PBX dialtone, dial "9" to get an outside line, and then get the phone
668    company's dialtone. In a situation like this, you need to tell the
669    modem to expect the secondary dialtone. On Hayes and compatible modems,
670    this is done by putting a "W" in the dial string at the appropriate
671    place. For example, to dial 9 for an outside line, and then 7654321,
672    use ATDT9W7654321:
673
674   SET PBX-OUTSIDE-PREFIX 9W
675
676    (replace "9" with whatever your PBX's outside-line prefix is).
677
678 6.7. The Busy Signal
679
680    Some phone companies are eliminating the busy signal. Instead, they
681    issue a voice message such as "press 1 to automatically redial until
682    the number answers, or...". Obviously this is a disaster for modem
683    calls. If your service has this feature, there's nothing Kermit can do
684    about it. Your modem will respond with NO CARRIER (after a long time)
685    rather than BUSY (immediately), and Kermit will declare the call a
686    failure, rather than trying to redial the same number.
687
688 6.8. Hanging Up
689
690    There are two ways to hang up a modem: by turning off the serial port's
691    DTR signal (SET MODEM HANGUP-METHOD RS232-SIGNAL) or sending the modem
692    its escape sequence followed by its hangup command (SET MODEM
693    HANGUP-METHOD MODEM-COMMAND). If one doesn't work, try the other. If
694    the automatic hangup performed at the beginning of a DIAL command
695    causes trouble, then SET DIAL HANGUP OFF.
696
697    The HANGUP command has no effect when C-Kermit is in remote mode. This
698    is on purpose. If C-Kermit could hang up its own controlling terminal,
699    this would (a) most likely leave behind zombie processes, and (b) pose
700    a security risk.
701
702    If you DIAL a modem, disconnect, then SET HOST or TELNET, and then
703    HANGUP, Kermit sends the modem's hangup command, such as "+++ATHO".
704    There is no good way to avoid this, because this case can't reliably be
705    distinguished from the case in which the user does SET HOST
706    terminal-server, SET MODEM TYPE name, DIAL. In both cases we have a
707    valid modem type selected and we have a network connection. If you want
708    to DIAL and then later make a regular network connection, you will have
709    to SET MODEM TYPE NONE or SET DIAL HANGUP OFF to avoid this phenomenon.
710
711 7. TERMINAL SERVERS
712
713    [ [65]Top ] [ [66]Contents ] [ [67]Next ] [ [68]Previous ]
714
715    Watch out for terminal server's escape character -- usually a control
716    character such as Ctrl-Circumflex (Ctrl-^). Don't unprefix it in
717    Kermit!
718
719    Ciscos -- must often be told to "terminal download"... Cisco ASM models
720    don't have hardware flow control in both directions.
721
722    Many terminal servers only give you a 7-bit connection, so if you can't
723    make it 8-bit, tell Kermit to "set parity space".
724
725    The following story, regarding trouble transferring 8-bit files through
726    a reverse terminal server, was contributed by an Annex terminal server
727    user:
728
729      Using C-Kermit on an HP 9000 712/80 running the HP-UX 10.0 operating
730      system. The HP was connected to a Xylogics Annex MICRO-ELS-UX R7.1 8
731      port terminal server via ethernet. On the second port of the
732      terminal server is an AT&T Paradyne 3810 modem, which is connected
733      to a telephone line. There is a program which runs on the HP to
734      establish a Telnet connection between a serial line on the Annex and
735      a character special file on the HP (/dev file). This is an Annex
736      specific program called rtelnet (reverse telnet) and is provided
737      with the terminal server software. The rtelnet utility runs on top
738      of the pseudo-terminal facility provided by UNIX. It creates
739      host-originiated connections to devices attached ot Annex serial
740      ports. There are several command line arguments to be specified with
741      this program: the IP address of the terminal server, the number of
742      the port to attach to, and the name of the pseudo-device to create.
743      In addition to these there are options to tell rtelnet how to
744      operate on the connect: -b requests negotiation for Telnet binary
745      mode, -d turns on socket-leve debugging, -f enables "connect on the
746      fly" mode, -r removes the device-name if it already exists, etc. The
747      most important of these to be specified when using 8 data bits and
748      no parity, as we found out, was the -t option. This creates a
749      transparent TCP connection to the terminal server. Again, what we
750      assumed to be happening was that the rtelnet program encountered a
751      character sequence special to itself and then "eating" those kermit
752      packets. I think this is all of the information I can give you on
753      the configuration, short of the values associated with the port on
754      the terminal server.
755
756    How to DIAL from a TCP/IP reverse terminal server (modem server):
757
758     1. (only if necessary) SET TELNET ECHO REMOTE
759     2. SET HOST terminal-server-ip-name-or-address [ port ]
760     3. SET MODEM TYPE modem-type
761     4. (only if necessary) SET DIAL HANGUP OFF
762     5. (for troubleshooting) SET DIAL DISPLAY ON
763     6. DIAL phone-number
764
765    The order is important: SET HOST before SET MODEM TYPE. Since this is a
766    Telnet connection, serial-port related commands such as SET SPEED, SET
767    STOP-BITS, HANGUP (when MODEM HANGUP-METHOD is RS232), etc, have no
768    effect. However, in C-Kermit 8.0, if the modem server supports
769    [69]RFC-2217 Telnet Com-Port Control protocol, these commands do indeed
770    take effect at the server's serial port.
771
772 8. TERMINAL EMULATION
773
774    [ [70]Top ] [ [71]Contents ] [ [72]Next ] [ [73]Previous ]
775
776    Except for the Windows, OS/2, and Macintosh versions, C-Kermit does not
777    emulate any kind of terminal. Rather, it acts as a "semitransparent
778    pipe", passing the characters you type during a CONNECT session to the
779    remote host, and sending the characters received from the remote host
780    to your screen. Whatever is controlling your keyboard and screen
781    provides the specific terminal emulation: a real terminal, a PC running
782    a terminal emulator, etc, or (in the case of a self-contained
783    workstation) your console driver, a terminal window, xterm, etc.
784
785    Kermit is semitrantsparent rather than fully transparent in the
786    following ways:
787
788      * During a TELNET ("set host") session, C-Kermit itself executes the
789        TELNET protocol and performs TELNET negotiations. (But it does not
790        perform TN3270 protocol or any other type of 3270 terminal
791        emulation.)
792      * If you have changed your keyboard mapping using SET KEY, C-Kermit
793        replaces the characters you type with the characters or strings
794        they are mapped to.
795      * If you SET your TERMINAL CHARACTER-SET to anything but TRANSPARENT,
796        C-Kermit translates your keystrokes (after applying any SET KEY
797        definitions) before transmitting them, and translates received
798        characters before showing them on your screen.
799      * If your remote and/or local TERMINAL CHARACTER-SET is an ISO 646
800        7-bit national character set, such as German, French, Italian,
801        Swedish, etc, or Short KOI used for Cyrillic, C-Kermit's CONNECT
802        command automatically skips over ANSI escape sequences to avoid
803        translating their characters. Only ANSI/ISO standard
804        (VT100/200/300-like) 7-bit escape sequence formats are supported
805        for this purpose, no proprietary schemes like H-P, Televideo,
806        Tektronix, etc.
807      * If your version of C-Kermit includes SET TERMINAL APC command, then
808        C-Kermit's CONNECT command will handle APC escape sequences if
809        TERMINAL APC is not set to OFF (which is the default).
810
811    You can make C-Kermit fully transparent by starting it with the -0
812    (dash zero) command-line option.
813
814    If you are running C-Kermit under a console driver, or in a terminal
815    window, that emulates the VT100, and use C-Kermit to log in to a VMS
816    system, the console driver or terminal window (not Kermit) is supposed
817    to reply to the "what are you?" query (ESC Z) from the VAX. If it
818    doesn't, and you can't make it do so, then you can (a) live with the
819    "unknown terminal" problem; (b) tell VMS to SET TERMINAL/DEVICE=VT100;
820    (c) program a key using SET KEY to send the appropriate sequence and
821    then punch the key at the right time; or (d) use the VMSLOGIN macro
822    that is defined in CKERMIT.INI to do this for you automatically.
823
824    SET SESSION-LOG { TEXT, BINARY }, which is effective in UNIX and AOS/VS
825    but not other C-Kermit versions, removes CR, DEL, NUL, XON, and XOFF
826    characters (Using C-Kermit neglects to mention that XON and XOFF are
827    removed). The TEXT-mode setting is ineffective during SCRIPT command
828    execution, as well as on X.25 connections.
829
830 9. KEY MAPPING
831
832    [ [74]Top ] [ [75]Contents ] [ [76]Next ] [ [77]Previous ]
833
834    Except in the terminal-emulating versions, C-Kermit's key mapping
835    facilities are limited to normal "ASCII" keys, and cannot be used with
836    function keys, arrow keys, arcane key combinations, etc. Since C-Kermit
837    runs on such a wide variety of hardware platforms (including, for
838    example, more than 360 different UNIX platforms), it is not possible
839    for C-Kermit to support every conceivable keyboard under every release
840    of every UNIX (or VMS, or ...) product on every different kind of
841    computer possibly under all manner of different console drivers, even
842    if it had the means to do so.
843
844    In technical terms, C-Kermit uses the read() function to read
845    keystrokes, and read() returns a single byte (value 0 through 255).
846    C-Kermit's SET KEY function applies to these single-byte codes.
847    "Extended function" keys, such as F-keys, arrow keys, etc, usually
848    return either a 2-byte "scan code" or else a character string (such as
849    an escape sequence like "<ESC> O p"). In both cases, C-Kermit has no
850    way to tell the difference between such multibyte key values, and the
851    corresponding series of single-byte key values. This could only be done
852    by accessing the keyboard at a much lower level in a highly
853    platform-dependent manner, probably requiring tens of thousands of
854    lines of code to support even a sampling of the most popular
855    workstation / OS combinations.
856
857    However, most workstation console drivers (terminal emulation windows,
858    etc) include their own key-mapping facility. For example in AIX, the
859    AIXterm program (in whose window you would run C-Kermit) allows
860    rebinding of the F1-F12 keys to arbitrary strings. The same is true of
861    Xterm and DECterm windows, etc. Consult the technical documentation for
862    your workstation or emulator. See sample Xterm (Xmodmap) mappings in
863    the [78]Unix C-Kermit Hints and Tips document.
864
865    The SET KEY command (except in Kermit 95) does not allow a key
866    definition to be (or contain) the NUL (\0) character.
867
868 10. FILE TRANSFER
869
870    [ [79]Top ] [ [80]Contents ] [ [81]Next ] [ [82]Previous ]
871
872    C-Kermit 7.0 is the first release of C-Kermit to use fast (rather than
873    robust and therefore slow) protocol defaults: long packets, sliding
874    windows, control-character unprefixing, and streaming where possible.
875    This makes most transfers (partner willing) dramatically faster "out of
876    the box" but might break some combinations that worked before. If
877    transfers with C-Kermit 7.0 or later fail where transfers worked with
878    earlier C-Kermit versions, try the following (one at a time, in this
879    order):
880
881     1. SET PREFIXING ALL: Disables control-character unprefixing.
882     2. SET STREAMING OFF: Disables streaming.
883     3. CAUTIOUS: Selects medium but cautious protocol settings.
884     4. ROBUST: this command reverts to the most conservative protocol
885        settings.
886
887    Execution of multiple file transfers by C-Kermit from a command file
888    when in remote mode might exhibit long delays between each transfer. To
889    avoid this, just include the command "SET DELAY 0" in your command file
890    before any of the file-transfer commands.
891
892    File transfer failures can occur for all sorts of reasons, most of them
893    listed in Chapter 10 of [83]Using C-Kermit. The following sections
894    touch on some that aren't.
895
896    The [84]C-Kermit 7.0 Release Notes document SEND /COMMAND as taking an
897    argument, but it doesn't. Instead of SEND /COMMAND:{some command}, use:
898
899 SEND /COMMAND [ other switches such as /AS-NAME: ] command [ arguments... ]
900
901 10.1. Laptops
902
903    Watch out for laptops and their assorted power-saver features; for
904    example, a built-in modem's "auto timeout delay" hanging up the
905    connection in the middle of a file transfer. Most modems, even if they
906    have this feature, do not have it enabled by default. But if you
907    experience otherwise inexplicable disconnections in the midst of your
908    Kermit sessions, check the modem manual for such things as "idle
909    timeout", "auto timeout", etc, and add the command to disable this
910    feature to Kermit's init string for this modem.
911
912 10.2. NFS
913
914    If uploading a large file to an NFS-mounted disk fails (or is painfully
915    slow), try uploading it to a local disk (e.g. /tmp on Unix) and then
916    copying to the NFS disk later.
917
918 10.3. Modems
919
920    If you are dialing out and find that downloads work but uploads don't,
921    try again with a lower serial-port speed. Case in point: dialing out on
922    a certain PC from Linux at 115200 bps using a USR Courier 56K
923    "V.Everything" external modem and RTS/CTS flow control. Downloads
924    worked flawlessly, uploads stopped dead after the first few packets
925    were sent. The modem lights showed constant retraining (ARQ light
926    blinks slowly), and the CTS light was off 95% of the time, allowing
927    nothing to get through. Reducing the serial port speed to 57600 bps
928    made the problems go away. Evidently the PC in question has a very fast
929    serial port, since dialing the same modem with a different PC at 115200
930    bps works without incident.
931
932 10.4. TCP/IP Connections
933
934    If you have trouble transferring files over a TCP/IP connection, tell
935    Kermit to SET PARITY SPACE and try again. If that doesn't work, also
936    try a shorter packet length or smaller window size (to compensate for
937    certain well-known broken Telnet servers), and/or SET RELIABLE OFF.
938
939 10.5. Multihop Connections
940
941    If you have a multihop connection, with the interior nodes in CONNECT
942    mode (Kermit, Telnet, Rlogin, or any other), you can expect (a) file
943    transfer to be slower, and (b) the connection to be less transparent
944    (to control characters, perhaps to the 8th bit) than a more direct
945    connection. C-Kermit 7.0 and later have a "-0" (dash-zero) command-line
946    option to make it 100% transparent in cases where it is to be used in
947    the middle.
948
949 10.6. Recovery
950
951    The recovery feature (RESEND command) that was added in version 5A(190)
952    works only for binary-mode transfers. In order for this feature to be
953    useful at all, the default for SET FILE INCOMPLETE was changed from
954    DISCARD to KEEP. Otherwise an interrupted transfer would leave no
955    partial file behind unless you had remembered to change the default.
956    But now you have to pay closer attention to Kermit's messages to know
957    whether a transfer succeeded or failed -- previously, if it failed, the
958    file would not show up on the receiving end at all; in 5A(190) and
959    later, you'll get a partial file which could easily be mistaken for the
960    complete file unless you change the default back to DISCARD or read the
961    screen messages, or keep a transaction log.
962
963 10.7. Filename Collisions
964
965    SET FILE COLLISION BACKUP is the default. This means:
966
967      * If you send the same file lots of times, there will be many backup
968        files. There is no automatic mechanism within Kermit to delete
969        them, no notion of a "version retention count", etc, but you can
970        use the PURGE command to clean them up.
971      * If a file arrives that has the same name as a directory, the file
972        transfer fails because Kermit will not rename a directory. Send the
973        file with another name, or use SET FILE COLLISION RENAME.
974      * If the directory lacks write permission, the file transfer fails
975        even if you have write access to the file that is being backed up;
976        in that case, switch to SET FILE COLLISION OVERWRITE or APPEND, or
977        send to a different directory.
978
979    SET FILE COLLISION UPDATE depends on the date/time stamp in the
980    attribute packet. However, this is recorded in local time, not
981    Universal Time (GMT), and there is no indication of time zone. The time
982    is expressed to the precision of 1 second, but some file systems do not
983    record with this precision -- for example, MS-DOS records the file
984    date/time only to the nearest 2 seconds. This might cause update
985    operations to send more files than necessary.
986
987    (This paragraph does NOT apply to UNIX, where, as of C-Kermit 7.0,
988    C-Kermit pipes incoming mail and print material directly the mail or
989    print program): When C-Kermit is receiving files from another Kermit
990    program that has been given the MAIL or REMOTE PRINT command, C-Kermit
991    follows the current filename collision action. This can be
992    disconcerting if the action was (for example) BACKUP, because the
993    existing file will be renamed, and the new file will be mailed (or
994    printed) and then deleted. Kermit cannot temporarily change to RENAME
995    because the file collision action occurs when the filename packet is
996    received, and the PRINT or MAIL disposition only comes later, in the
997    Attribute packet.
998
999    Watch out for SET FILE COLLISION RENAME, especially when used in
1000    conjunction with recovery. Recall that this option (which is NOT the
1001    default) renames the incoming file if a file already exists with the
1002    same name (the default is to rename the previously existing file, and
1003    store the incoming file with its own name). It is strongly recommended
1004    that you do not use SET FILE COLLISION RENAME if you ever intend to use
1005    the recovery feature:
1006
1007      * When the file is first received by C-Kermit, its name is changed if
1008        another file already has the same name. When you RESEND the same
1009        file after a failure, C-Kermit will probably try to append the
1010        re-sent portion to the wrong file.
1011      * Assuming that you get RESEND to work with FILE COLLISION RENAME,
1012        C-Kermit, when receiving the remainder of the file during a RESEND
1013        operation, will report back the wrong name. Nothing can be done
1014        about this because the name is reported back before the receiving
1015        Kermit program finds out that it is a recovery operation.
1016
1017    Also watch out for DISABLE DELETE, since this implicitly sets FILE
1018    COLLISION to RENAME. And note tht DELETE is DISABLEd automatically any
1019    time you Kermit is in local mode (i.e. it makes a connection). Also
1020    note that for purposes of DISABLE and ENABLE, "set host *" connections
1021    do not count as local mode even though, strictly speaking, they are.
1022
1023 10.8. DOS Pathnames
1024
1025    When referring to foreign MS-DOS, Windows, Atari ST, OS/2, or other
1026    file specifications that contain backslash characters in a C-Kermit
1027    command, you might have to double each backslash, for example:
1028
1029   C-Kermit>get c:\\directory\\foo.txt
1030
1031    This is because backslash is used in C-Kermit commands for introducing
1032    special character codes, variables, functions, etc.
1033
1034 10.9. Cancellation
1035
1036    If attempting to cancel local-mode file reception at a very early stage
1037    (i.e. before data packets are exchanged) with X or Z does not work, use
1038    E or Ctrl-C instead, or wait until the first data packets are sent.
1039
1040    If you cancel a transfer that is underway using X or Z, and a lot of
1041    window slots are in use, it might take a while for the cancellation to
1042    take effect, especially if you do this on the receiving end; that's
1043    because a lot of packets might already be on their way to you. In that
1044    case, just be patient and let Kermit "drain" them.
1045
1046    If C-Kermit is sending a file, remote-mode packet-mode breakout (three
1047    consecutive Ctrl-C's by default) is not effective until after C-Kermit
1048    sends its first packet. If C-Kermit is receiving a file or is in server
1049    mode, it is effective right away. In the former case, the SET DELAY
1050    value determines the earliest time at which you can break out of packet
1051    mode.
1052
1053 10.10. Partner Peculiarities
1054
1055    When one or both partners is on an SCO operating system such as OSR5,
1056    you might issue the command:
1057
1058 mapchan -n
1059
1060    to disable character-set conversion by the terminal driver. Similarly
1061    for AIX:
1062
1063 setmaps -t NOMAP
1064
1065    When using C-Kermit to transfer files with the HP48SX calculator, you
1066    must SET FLOW NONE. The HP48SX does not support flow control, and
1067    evidently also becomes confused if you attempt to use it. You might
1068    also need to use SET SEND PAUSE 100 (or other number). For greater
1069    detail about transferring files the the HP-48, see:
1070
1071   [85]http://www.columbia.edu/kermit/hp48.html
1072
1073    Some communication programs have errors in their implementation of
1074    Kermit attribute packets. If you get an error message from your
1075    communication program like "Attribute error", tell C-Kermit to SET
1076    ATTRIBUTES OFF. Better yet, switch to a real Kermit program.
1077
1078    Some communication software claims to implement Kermit sliding windows,
1079    but does so incorrectly. If sliding window transfers fail, set
1080    C-Kermit's window size to the smallest one that works, for example, SET
1081    WINDOW 1.
1082
1083    For lots more detail about how to cope with defective Kermit partners,
1084    see:
1085
1086      * [86]Coping with Faulty Kermit Implementations (C-Kermit 7.0 and
1087        later).
1088      * [87]Coping with Broken Kermit Partners (C-Kermit 8.0 and later).
1089
1090    The UNIX version of C-Kermit discards carriage returns when receiving
1091    files in text mode. Thus, "bare" carriage returns (sometimes used to
1092    achieve overstriking) are lost.
1093
1094 11. SCRIPT PROGRAMMING
1095
1096    [ [88]Top ] [ [89]Contents ] [ [90]Previous ]
1097
1098 11.1. Comments Versus the SCRIPT Command
1099
1100    Remember that ";" and "#" introduce comments when (a) they are the
1101    first character on the line, or (b) they are preceded by at least one
1102    blank or tab within a line. Thus constructions like:
1103
1104   INPUT 5 ;
1105   SCRIPT ~0 #--#--#
1106
1107    must be coded using backslash notation to keep the data from being
1108    ignored:
1109
1110   INPUT 5 \59                   ; 59 is the decimal ASCII code for ";"
1111   SCRIPT ~0 \35--#--#           ; 43 is the decimal ASCII code for "#"
1112
1113    or, more simply:
1114
1115   INPUT 5 \;                    ; Just quote the semicolon
1116   SCRIPT ~0 \#--#--#            ; Just quote the "#"
1117
1118 11.2. Alphabetic Case and the INPUT Command
1119
1120    INPUT and MINPUT caseless string comparisons do not work for non-ASCII
1121    (international) characters. Workaround: SET INPUT CASE OBSERVE. Even
1122    then, the "lexically less than" and "lexically greater than" operations
1123    (IF LLT, IF LGT) probably won't work as expected. The same is true for
1124    the case-conversion functions \Flower() and \Fupper(). C-Kermit does
1125    not know the collating sequence for different character sets and
1126    languages. (On the other hand, it might work depending on such items as
1127    how Kermit was linked, whether your operating supports "locales", etc)
1128
1129 11.3. NUL (0) Characters in C-Kermit Commands
1130
1131    You can't include a NUL character (\0) in C-Kermit command text without
1132    terminating the character string in which it appears. For example:
1133
1134   echo In these brackets [\0] is a NUL
1135
1136    will echo "In these brackets [". This applies to ECHO, INPUT, OUTPUT,
1137    and all other commands (but you can represent NUL by "\N" in an OUTPUT
1138    string). This is because C-language strings are terminated internally
1139    by the NUL character, and it allows all of C-Kermit's string comparison
1140    and manipulation functions to work in the normal "C" way.
1141
1142    To illustrate:
1143
1144   INPUT 5 \0
1145
1146    is equivalent to:
1147
1148   INPUT 5
1149
1150    and:
1151
1152   INPUT 5 ABC\0DEF
1153
1154    is equivalent to:
1155
1156   INPUT 5 ABC
1157
1158    INPUT operations discard and ignore NUL characters that arrive from the
1159    communication device, meaning that they do not figure into matching
1160    operations (e.g. A<NUL>B matches AB); they are not deposited in the
1161    INPUT buffer (\v(input)); and they are not counted in \v(incount), with
1162    two exceptions:
1163
1164     1. An arriving NUL character restarts the INPUT SILENCE timer.
1165     2. An arriving NUL character terminates the INPUT command with the
1166        SUCCESS condition if the INPUT command was given an empty search
1167        string. In this case \v(incount) is set to 1.
1168
1169    Also, the \v(inchar) variable is null (completely empty) if the last
1170    INPUT character was NUL. That is, there is no way to tell only by
1171    looking at \v(inchar) the difference between a NUL that was INPUT and
1172    no INPUT at all. If the INPUT command succeeded but \v(inchar) is
1173    empty, then a NUL character was input. Also, \v(incount) will be set to
1174    1.
1175
1176    Here's a sample script fragment to read characters, possibly including
1177    NUL, from the communication connection and write them to a file:
1178
1179   while true {
1180       input 1                      ; read one byte
1181       if fail break                ; timed out or connection closed
1182       fwrite /char \%c \v(inchar)  ; record the byte
1183   }
1184
1185    This works because when \v(inchar) is NUL, that's equivalent to FWRITE
1186    /CHAR having no text argument at all, in which case it writes a NUL
1187    character.
1188
1189    \v(incount) and \v(inchar) are NOT affected by the CLEAR command.
1190
1191 11.4. \ffiles() and \fnextfile() Peculiarities
1192
1193    The following script program:
1194
1195   for \%i 1 \ffiles(oofa.*) 1 {
1196       send \fnextfile()
1197   }
1198
1199    did not work as expected in C-Kermit 6.0 and earlier but does work in
1200    C-Kermit 7.0 and later.
1201
1202 11.5. Commands That Have Only Local Effect
1203
1204    Certain settings are local to each command level, meaning that
1205    subordinate command levels (macros or command files) can change them
1206    without affecting their values at higher command levels. When a new
1207    command level is invoked, the value is inherited from the previous
1208    level. These settings are:
1209
1210   CASE
1211   COUNT and \v(count)
1212   INPUT CASE
1213   INPUT TIMEOUT
1214   MACRO ERROR
1215   QUIET
1216   TAKE ERROR
1217
1218    This arrangement allows CASE, TIMEOUT, and ERROR settings, which are
1219    used to control automatic exit from a command file or macro upon error,
1220    to be automatically restored when the command file or macro exits.
1221
1222    The COUNT variable follows this rule too, which permits nested SET
1223    COUNT / IF COUNT loops, as in this example in which the inner loop
1224    counts down from the current COUNT value of the outer loop (try it):
1225
1226   DEFINE INNER WHILE COUNT { WRITE SCREEN {   Inner:}, SHOW COUNT }
1227   SET COUNT 5
1228   WHILE COUNT { WRITE SCREEN Outer:, SHOW COUNT, DO INNER }
1229
1230    Keep in mind that an inferior command level cannot manipulate the COUNT
1231    value held by a higher level. For example:
1232
1233   DEFINE OOFA SHOW COUNT, IF COUNT GOTO LOOP
1234   SET COUNT 5
1235   :LOOP
1236   OOFA
1237   ECHO Done
1238
1239    results in an infinite loop; the COUNT value remains at 5 because it is
1240    never decremented at the same level at which it was set.
1241
1242 11.6. Literal Braces in Function Calls
1243
1244    Since braces are used in function calls to indicate grouping, there is
1245    no way to pass literal braces to the function itself. Solution: Define
1246    a variable containing the string that has braces. Example:
1247
1248   define \%a ab{cd
1249   echo \fsubstring(\%a)
1250   ab{cd
1251
1252    If the string is to start with a leading brace and end with a closing
1253    brace, then double braces must appear around the string (which itself
1254    is enclosed in braces):
1255
1256   define \%a {{{foo}}}
1257   echo \fsubstring(\%a)
1258   {foo}
1259
1260    This also works for any other kind of string:
1261
1262   define \%a {{ab{cd}}
1263   echo \fsubstring(\%a)
1264   ab{cd
1265
1266 11.7. Defining Variables on the C-Kermit Command Line
1267
1268    To define variables on the C-Kermit command line, use the -C
1269    command-line option with one or more DEFINE or ASSIGN commands. Note
1270    that the C-Kermit command line must cope with the quoting rules of your
1271    shell. Examples:
1272
1273   kermit -C "define \\%a foo, define phonenumber 7654321"
1274
1275    In this case we follow UNIX quoting rules by doubling the backslash.
1276    Once C-Kermit starts, the \%a and \m(phonenumber) variables are defined
1277    as indicated and can be used in the normal way.
1278
1279    In DOS or Windows or OS/2 the command would be:
1280
1281   kermit -C "define \%%a foo, define phonenumber 7654321"
1282
1283    Here we need to double the percent sign rather than the backslash
1284    because of DOS shell quoting rules.
1285
1286 11.8. Per-Character Echo Check with the OUTPUT Command
1287
1288    Sometimes the OUTPUT command must be used to send commands or data to a
1289    device in "echoplex" mode, meaning that characters must be sent one at
1290    a time, and the next character can not be sent until the echo from the
1291    previous one has been received. For example, a certain PBX might have
1292    this characteristic. Let's say a Kermit script is used to program the
1293    PBX. If characters are sent too fast, they can be lost. It would seem
1294    that the command:
1295
1296   SET OUTPUT PACING milliseconds
1297
1298    could be used to take care of this, but the pacing interval is constant
1299    and must be set large enough to allow even the slowest echo to finish.
1300    If the script is large (an actual example is 14,000 lines long), this
1301    can cause it to take hours longer than it needs to.
1302
1303    Here is a macro you can use to OUTPUT a string in an Echoplex
1304    environment:
1305
1306   define XOUTPUT {
1307       local \%c \%i
1308       set output pacing 0
1309       for \%i 1 \flen(\%*) 1 {
1310           asg \%c \fsubstr(\%*,\%i,1)
1311           output \%c
1312           input 2 \%c
1313       }
1314   }
1315
1316    C-Kermit 7.0 or later is required.
1317
1318    It sends one character at a time and then waits up to 2 seconds for the
1319    character to be echoed back, but continues to the next character as
1320    soon as the echo appears, so no time is wasted. You can add an IF FAIL
1321    clause after the INPUT in case you want to do something special about
1322    failure to detect an echo within the timeout period. Obviously you can
1323    also change the 2-second limit, and adjust the script in any other
1324    desired way.
1325
1326 11.9. Scripted File Transfer
1327
1328    Sometimes a user complains that when she makes a connection by hand,
1329    logs in, and transfers a file, there are no problems, but when she
1330    scripts the the exact same sequence, the file transfer always fails
1331    after a few packets. Here's a scenario where this can happen:
1332
1333     1. Upon logging in to the remote computer, it sends a "What Are You?"
1334        escape sequence.
1335     2. When you log in interactively, your terminal emulator sends the
1336        response. This is invisible to you; you don't know it's happening.
1337     3. When you script the login, and begin a file transfer immediately
1338        upon logging in, the host still sends the "What Are You?" sequence.
1339        Kermit's INPUT ECHO setting is ON by default, so the escape
1340        sequence passes through to the terminal, and the terminal sends its
1341        response. But by this time Kermit has already started the file
1342        transfer.
1343     4. By default, the local Kermit program examines the keyboard for
1344        interruption characters between every packet. The "What Are You"
1345        response is sitting in the keyboard buffer. Eventually Kermit will
1346        read a character such as "c" that is a valid interruption
1347        character, and the file transfer stops with "User cancelled".
1348
1349    The right way to handle this situation is to have your look for the
1350    "What Are You?" sequence and send the response itself, as described in
1351    Using C-Kermit, pp.429-431. Or you can work around it by telling the
1352    local Kermit to "set input echo off" and/or "set transfer interruption
1353    off".
1354
1355 11.10. Hexadecimal arithmetic...
1356
1357    C-Kermit can do both integer and floating-point arithmetic, in both
1358    ordinary algebraic notation and in Lisp S-Expression notation. All
1359    arithmetic operators and functions operate only on decimal numbers. It
1360    is possible, however, to write scripts that operate on hexadecimal
1361    numbers. This is done by converting them to decimal prior to any
1362    arithmetic operations, and then converting them back to hexadecimal for
1363    display. Example:
1364
1365 ; EVALUATE is a command that evaluates an arithmetic expression.
1366 ; See HELP EVALUATE for details.  This is just for demonstration.
1367 ; Arithmetic expressions can be used in any context where a number
1368 ; can be used.  Also, the special notation:
1369 ;
1370 ; .\%a ::= expression
1371 ;
1372 ; evaluations the expression and assigns the result to the variable.
1373 ;
1374 .\%a := fffe                ; Set variable to hex value
1375 set eval old                ; See HELP EVAL
1376 eval \fhex2n(\%a)           ; Show value of variable
1377 eval \fhex2n(\%a) + 1       ; Show value of expression
1378 eval \fhex2n(\%a) + 2       ; Show value of expression
1379 .\%x ::= \fhex2n(\%a) + 1   ; Assign value of expression to variable
1380 echo \fn2hex(\%x)           ; Display variable's value in hex
1381 .\%x ::= \fhex2n(\%a) + 2   : Ditto
1382 echo \fn2hex(\%x)
1383 .\%x ::= \fhex2n(\%a) | \fhex2n(ffff)  ; Similarly for logical OR
1384 echo \fn2hex(\%x)
1385 .\%x ::= \fhex2n(\%a) & \fhex2n(ffff)  ; and logical AND
1386 echo \fn2hex(\%x)
1387
1388    By the way, you might be tempted to use Kermit's \xnn notation to plug
1389    hex numbers into arithmetic expressions but this doesn't work. That
1390    notation is stricly for bytes (hex representation of character values),
1391    not for numbers.
1392
1393 11.11. Other...
1394
1395    Escape sequences (or any strings that contain control characters) can't
1396    be used as labels, GOTO targets, or SWITCH cases.
1397
1398    [ [91]Top ] [ [92]Contents ] [ [93]C-Kermit Home ] [ [94]C-Kermit 8.0
1399    Overview ] [ [95]Kermit Home ]
1400      __________________________________________________________________
1401
1402    C-Kermit 8.0 Unix Hints and Tips / [96]The Kermit Project /
1403    [97]kermit@columbia.edu / 30 June 2011
1404
1405 References
1406
1407    1. http://www.columbia.edu/
1408    2. mailto:kermit@columbia.edu
1409    3. http://www.columbia.edu/kermit/index.html
1410    4. http://www.columbia.edu/kermit/k95.html
1411    5. http://www.columbia.edu/kermit/ckermit.html
1412    6. http://www.columbia.edu/kermit/ckscripts.html
1413    7. http://www.columbia.edu/kermit/current.html
1414    8. http://www.columbia.edu/kermit/whatsnew.html
1415    9. http://www.columbia.edu/kermit/faq.html
1416   10. http://www.columbia.edu/kermit/support.html
1417   11. http://www.columbia.edu/kermit/ckcbwr.html
1418   12. http://www.columbia.edu/kermit/ckubwr.html
1419   13. http://www.columbia.edu/kermit/k95.html
1420   14. http://www.columbia.edu/kermit/ckermit.html
1421   15. http://www.columbia.edu/kermit/ckututor.html
1422   16. http://www.columbia.edu/kermit/ckcbwr.html#x0
1423   17. http://www.columbia.edu/kermit/ckcbwr.html#x1
1424   18. http://www.columbia.edu/kermit/ckcbwr.html#x2
1425   19. http://www.columbia.edu/kermit/ckcbwr.html#x3
1426   20. http://www.columbia.edu/kermit/ckcbwr.html#x4
1427   21. http://www.columbia.edu/kermit/ckcbwr.html#x5
1428   22. http://www.columbia.edu/kermit/ckcbwr.html#x6
1429   23. http://www.columbia.edu/kermit/ckcbwr.html#x7
1430   24. http://www.columbia.edu/kermit/ckcbwr.html#x8
1431   25. http://www.columbia.edu/kermit/ckcbwr.html#x9
1432   26. http://www.columbia.edu/kermit/ckcbwr.html#x10
1433   27. http://www.columbia.edu/kermit/ckcbwr.html#x11
1434   28. http://www.columbia.edu/kermit/ckcbwr.html#top
1435   29. http://www.columbia.edu/kermit/ckcbwr.html#contents
1436   30. http://www.columbia.edu/kermit/ckcbwr.html#x2
1437   31. http://www.columbia.edu/kermit/ckcbwr.html#top
1438   32. http://www.columbia.edu/kermit/ckcbwr.html#contents
1439   33. http://www.columbia.edu/kermit/ckcbwr.html#x2
1440   34. http://www.columbia.edu/kermit/ck60manual.html
1441   35. http://www.columbia.edu/kermit/ckermit2.html
1442   36. http://www.columbia.edu/kermit/ck60manual.html
1443   37. http://www.columbia.edu/kermit/ckermit80.html#x5
1444   38. http://www.columbia.edu/kermit/ckermit80.html
1445   39. http://www.columbia.edu/kermit/ckermit80.html#x2.2
1446   40. http://www.columbia.edu/kermit/ckermit80.html#x8.7.2
1447   41. http://www.columbia.edu/kermit/ckermit80.html#x9
1448   42. http://www.columbia.edu/kermit/ckcbwr.html#top
1449   43. http://www.columbia.edu/kermit/ckcbwr.html#contents
1450   44. http://www.columbia.edu/kermit/ckcbwr.html#x3
1451   45. http://www.columbia.edu/kermit/ckcbwr.html#x1
1452   46. http://www.columbia.edu/kermit/ckcbwr.html#top
1453   47. http://www.columbia.edu/kermit/ckcbwr.html#contents
1454   48. http://www.columbia.edu/kermit/ckcbwr.html#x4
1455   49. http://www.columbia.edu/kermit/ckcbwr.html#x2
1456   50. http://www.columbia.edu/kermit/ckcbwr.html#top
1457   51. http://www.columbia.edu/kermit/ckcbwr.html#contents
1458   52. http://www.columbia.edu/kermit/ckcbwr.html#x5
1459   53. http://www.columbia.edu/kermit/ckcbwr.html#x3
1460   54. ftp://ftp.isi.edu/in-notes/rfc1122.txt
1461   55. http://www.columbia.edu/kermit/ckcbwr.html#top
1462   56. http://www.columbia.edu/kermit/ckcbwr.html#contents
1463   57. http://www.columbia.edu/kermit/ckcbwr.html#x6
1464   58. http://www.columbia.edu/kermit/ckcbwr.html#x4
1465   59. http://www.columbia.edu/kermit/ckcbwr.html#top
1466   60. http://www.columbia.edu/kermit/ckcbwr.html#contents
1467   61. http://www.columbia.edu/kermit/ckcbwr.html#x7
1468   62. http://www.columbia.edu/kermit/ckcbwr.html#x5
1469   63. http://www.columbia.edu/kermit/ck60manual.html
1470   64. http://www.columbia.edu/kermit/ckcbwr.html#x10
1471   65. http://www.columbia.edu/kermit/ckcbwr.html#top
1472   66. http://www.columbia.edu/kermit/ckcbwr.html#contents
1473   67. http://www.columbia.edu/kermit/ckcbwr.html#x8
1474   68. http://www.columbia.edu/kermit/ckcbwr.html#x6
1475   69. ftp://ftp.isi.edu/in-notes/rfc2217.txt
1476   70. http://www.columbia.edu/kermit/ckcbwr.html#top
1477   71. http://www.columbia.edu/kermit/ckcbwr.html#contents
1478   72. http://www.columbia.edu/kermit/ckcbwr.html#x9
1479   73. http://www.columbia.edu/kermit/ckcbwr.html#x7
1480   74. http://www.columbia.edu/kermit/ckcbwr.html#top
1481   75. http://www.columbia.edu/kermit/ckcbwr.html#contents
1482   76. http://www.columbia.edu/kermit/ckcbwr.html#x10
1483   77. http://www.columbia.edu/kermit/ckcbwr.html#x8
1484   78. http://www.columbia.edu/kermit/ckubwr.html
1485   79. http://www.columbia.edu/kermit/ckcbwr.html#top
1486   80. http://www.columbia.edu/kermit/ckcbwr.html#contents
1487   81. http://www.columbia.edu/kermit/ckcbwr.html#x11
1488   82. http://www.columbia.edu/kermit/ckcbwr.html#x9
1489   83. http://www.columbia.edu/kermit/ck60manual.html
1490   84. http://www.columbia.edu/kermit/ckermi70.htm
1491   85. http://www.columbia.edu/kermit/hp48.html
1492   86. http://www.columbia.edu/kermit/ckermit70.html#x4.22
1493   87. http://www.columbia.edu/kermit/ckermit80.html#x15
1494   88. http://www.columbia.edu/kermit/ckcbwr.html#top
1495   89. http://www.columbia.edu/kermit/ckcbwr.html#contents
1496   90. http://www.columbia.edu/kermit/ckcbwr.html#x10
1497   91. http://www.columbia.edu/kermit/ckcbwr.html#top
1498   92. http://www.columbia.edu/kermit/ckcbwr.html#contents
1499   93. http://www.columbia.edu/kermit/ckermit.html
1500   94. http://www.columbia.edu/kermit/ck80.html
1501   95. http://www.columbia.edu/kermit/index.html
1502   96. http://www.columbia.edu/kermit/index.html
1503   97. mailto:kermit@columbia.edu