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