📄 ckermit2.txt
字号:
The numeric day of the week for the given date. If a time is included, it is ignored. Example: \fnday(8 Feb 1988) = "1".\v(date) The current date as dd mmm yyyy, e.g. "08 Feb 2000" (as in this example, a leading zero is supplied for day-of-month less than 10).\v(ndate) The current date in numeric format: yyyymmdd, e.g. "20000208".\v(time) The current time as hh:mm:ss, e.g. "15:27:14".\ftime(time) The given free-format date and/or time (e.g. "3pm") returns the time (without the date) converted to hh:mm:ss 24-hour format, e.g. "15:00:00" (the date, if given, is ignored).\v(ntime) The current time as seconds since midnight, e.g. "55634".\v(tftime) The elapsed time of the most recent file-transfer operation in seconds.\v(intime) The elapsed time for the most recent INPUT command to complete, in milliseconds.\fntime(time) The given free-format date and/or time is converted to seconds since midnight (the date, if given, is ignored). This function replaces \ftod2secs(), which is now a synonym for \fntime(). Unlike \ftod2secs(), \fntime() allows a date to be included, and it allows the time to be in free format (like 3pm), and it allows the amount of time to be more than 24 hours. E.g. \fntime(48:00:00) = 172800. Example of use: set alarm \fntime(48:00:00) ; set alarm 48 hours from now.\fn2time(seconds) The given number of seconds is converted to hh:mm:ss format.\fdate(filename) Returns the modification date-time of the given file in standard format: yyyymmdd hh:mm:ss.\fcvtdate(date-time) Converts a free-format date and/or time to Kermit standard format: yyyymmdd hh:mm:ss. If no argument is given, returns the current date-time in standard format. If a date is given but no time, the converted date is returned without a time. If a time is given with no date, the current date is supplied. Examples: \fcvtdate(4 Jul 2000 2:21:17pm) = 20000704 14:21:17 \fcvtdate() = 20000704 14:21:17 (on 4 Jul 2000 at 2:21:17pm). \fcvtd(4 Jul 2000) = 20000704 \fcvtd(6pm) = 20000704 18:00:00 (on 4 Jul 2000 at 6:00pm).\fdayofyear(date-time)\fdoy(date-time) Converts a free-format date and/or time to yyyyddd, where ddd is the 3-digit day of the year, where 1 January is Day 1. If a time is included with the date, it is returned in standard format. If a date is included but no time, the date is returned without a time. If a time is given with no date, the time is converted and the current date is supplied. If no argument is given, the current date-time is returned. Synonym: \fdoy(). Examples: \fddayofyear(4 Jul 2000 2:21:17pm) = 2000185 14:21:17 \fdoy() = 2000185 14:21:17 (on 4 Jul 2000 at 2:21:17pm). \fdoy(4 Jul 2000) = 2000185 \fdoy(6pm) = 2000185 18:00:00 (on 4 Jul 2000 at 6:00pm).Note: The yyyyddd day-of-year format is often erroneously referred to as aJulian date. However, a true Julian date is a simple counting number, thenumber of days since a certain fixed day in the past. See \fmjd() below.\fdoy2date(date-time) Converts a date or date-time in day-of-year format to a standard format date. A yyyyddd-format date must be supplied; time is optional. The given date is converted to yyyymmdd format. If a time is given, it is converted to 24-hour format. Examples: \fdoy2date(2000185) = 20000704 \fdoy2(2000185 3pm) = 20000704 15:00:00\fmjd(date-time) Converts free-format date and/or time to a Modified Julian Date (MJD), the number of days since 17 Nov 1858 00:00:00. If a time is given, it is ignored. Examples: \fmjd(4 Jul 2000) = 50998 \fmjd(17 Nov 1858) = 0 \fmjd(16 Nov 1858) = -1\fmjd2date(mjd) Converts an MJD (integer) to standard date format, yyyymmdd: \fmjd2(50998) = 4 Jul 1998 \fmjd2(0) = 17 Nov 1858 \fmjd2(-1) = 16 Nov 1858 \fmjd2(-365) = 17 Nov 1857MJDs are normal integers and, unlike DOYs, may be added, subtracted, etc, witheach other or with other integers, to obtain meaningful results. For example,to find out the date 212 days ago: echo \fmjd2date(\fmjd()-212)Constructions such as this can be used in any command where a date-timeis required, e.g.: send /after:\fmjd2date(\fmjd()-212)to send all files that are not older than 212 days (this is equivalent to"send /after:-212days").MJDs also have other regularities not exhibited by other date formats. Forexample, \fmodulus(\fmjd(any-date),7) gives the day of the week for any date(where 4=Sun, 5=Mon, ..., 3=Sat). (However, it is easier to use \fnday() forthis purpose, and it gives the more conventional result of 0=Sun, 1=Mon, ...,6=Sat).Note that if MJDs are to be compared, they must be compared numerically(IF <, =, >) and not lexically (IF LLT, EQUAL, LGT), whereas DOYs must becompared lexically if they include a time (which contains ":" characters);however, if DOYs do not include a time, they may also be compared numerically.In any case, lexical comparison of DOYs always produces the appropriateresult, as does numeric comparison of MJDs.The same comments apply to sorting. Also note that DOYs are fixed length, butMJDs can vary in length. However, all MJDs between 3 April 1886 and 30 Aug2132 are 5 decimal digits long. (MJDs become 6 digits long on 31 Aug 2132,and 7 digits long on 13 Oct 4596).1.7. Partial Completion of KeywordsPartial completion of keywords was added in C-Kermit 7.0. In prior versions,if completion was attempted (by pressing the Esc or Tab key) on a string thatmatched different keywords, you'd just get a beep. Now Kermit completes up tothe first character where the possibly matching keywords differ and thenbeeps. For example: send /n<Tab>which matches /NOT-BEFORE and /NOT-AFTER, now completes up to the dash: send /n<Tab>ot-<Beep>Partial completion works for filenames too (as it has for some years).1.8. Command RecallC-Kermit has had a command history buffer for some time, which could bescrolled interactively using control characters or (in Kermit 95 only) arrowkeys. Version 7.0 adds a REDO command that allows the most recent commandmatching a given pattern to be re-executed:{ REDO, RR, ^ } [ <pattern> ] Search the command history list for the most recent command that matches the given pattern, and if one is found, execute it again.The pattern can be a simple string (like "send"), in which case the last SENDcommand is re-executed. Or it can contain wildcard characters "*" and/or "?",which match any string and any single character, respectively (note that "?"must be preceded by backslash to override its normal function of giving help),and in most C-Kermit versions may also include [] character lists and {}string lists (see Section 4.9).The match works by appending "*" to the end of the given pattern (if youdidn't put one there yourself). Thus "redo *oofa" becomes "redo *oofa*" andtherefore matches the most recent command that contains "oofa" anywhere withinthe command. If you want to inhibit the application of the trailing "*",e.g. to force matching a string at the end of a command, enclose the patternin braces: redo {*oofa}matches the most recent command that ends with "oofa".REDO commands themselves are not entered into the command history list. If nopattern is given, the previous (non-REDO) command is re-executed. The REDOnecommand is reinserted at the end of the command history buffer, so the commandscrollback character (Ctrl-P, Ctrl-B, or Uparrow) can retrieve it.Examples: C-Kermit>echo foo foo C-Kermit>show alarm (no alarm set) C-Kermit>echo blah blah C-Kermit>redo ; Most recent command blah C-Kermit>redo s ; Most recent command starting with "s" (no alarm set) C-Kermit>redo echo f ; Most recent command starting with "echo f" foo C-Kermit>redo *foo ; Most recent command that has "foo" in it foo C-Kermit><Ctrl-P> ; Scroll back C-Kermit>echo foo ; The REDOne command is there C-Kermit>redo {*foo} ; Most recent command that ends with "foo" foo C-Kermit>Since REDO, REDIAL, and REDIRECT all start the same way, and RED is thedesignated non-unique abbreviation for REDIAL, REDO must be spelled out infull. For convenience, RR is included as an invisible easy-to-type synonymfor REDO. You can also use the "^" character for this: C-Kermit>^ ; Most recent command C-Kermit>^ s ; Most recent command starting with "s" C-Kermit>^s ; Ditto (space not required after "^"). C-Kermit>^*foo ; Most recent command that has "foo" in it. C-Kermit>^{*foo} ; Most recent command ends with "foo".Unlike the manual command-history-scrolling keys, the REDO command can beused in a script, but it's not recommended (since the command to be REDOnemight not be found, so if the REDO command fails, you can't tell whether itwas because REDO failed to find the requested command, or because the commandwas found but it failed).1.9. EXIT MessagesThe EXIT and QUIT commands now accept an optional message to be printed.This makes the syntax of EXIT and QUIT just like END and STOP: { EXIT, QUIT, END, STOP } [ <status-code> [ <message> ] ]where <status-code> is a number (0 indicating success, nonzero indicatingfailure). This is handy in scripts that are never supposed to enterinteractive mode: dial 7654321 if fail exit 1 Can't make connection - try again later.Previously this could only be done in two steps: dial 7654321 xif fail { echo Can't make connection - try again later, exit 1 }A status code must be included in order to specify a message. In the caseof EXIT and QUIT, the default status code is contained in the variable\v(exitstatus), and is set automatically by various events (file transferfailures, etc; it can also be set explicitly with the SET EXIT STATUScommand). If you want to give an EXIT or QUIT command with a message, butwithout changing the exit status from what it normally would have been, usethe \v(exitstatus) variable, e.g.: exit \v(existatus) Goodbye from \v(cmdfile).The EXIT status is returned to the system shell or whatever other processinvoked C-Kermit, e.g. in UNIX: C-Kermit> exit 97 bye bye bye bye $ echo $? 97 $1.10. Managing Keyboard InterruptionsWhen C-Kermit is in command or file-transfer mode (as opposed to CONNECTmode), it can be interrupted with Ctrl-C. Version 7.0 adds the ability todisarm the Ctrl-C interrupt:SET COMMAND INTERRUPT { ON, OFF } COMMAND INTERRUPT is ON by default, meaning the Ctrl-C can be used to interrupt a command or a file transfer in progress. Use OFF to disable these interruptions, and use it with great caution for obvious reasons.SET TRANSFER INTERRUPT { ON, OFF } This can be used to disable keyboard interruption of file transfer when C-Kermit is in local mode, or to re-enable it after it has been disabled. This applies to the X, Z, E, and similar keys as well as to the system interrupt character, usually Ctrl-C. This is distinct from SET TRANSFER CANCELLATION, which tells whether packet mode can be exited by sending a special sequence of characters.Several other commands can be interrupted by pressing any key while they areactive. Version 7.0 adds the ability to disable this form of interruptionalso:SET INPUT CANCELLATION { ON, OFF } Whether an INPUT command in progress can be interrupted by pressing a key. Normally ON. Setting INPUT CANCELLATION OFF makes INPUT commands uninterruptible except by Ctrl-C (unless COMMAND INTERRUPTION is also OFF).SET SLEEP CANCELLATION { ON, OFF } Whether a SLEEP, PAUSE, or WAIT command in progress can be interrupted by pressing a key. Normally ON. Setting SLEEP CANCELLATION OFF makes these commands uninterruptible except by Ctrl-C (unless COMMAND INTERRUPTION is also OFF). Synonyms: SET PAUSE CANCELLATION, SET WAIT CANCELLATION.So to make certain a script is not interruptible by the user, include thesecommands: SET TRANSFER INTERRUPT OFF SET SLEEP CANCELLATION OFF SET INPUT CANCELLATION OFF SET COMMAND INTERRUPTION OFFMake sure to turn them back on afterwards.When a PAUSE, SLEEP, WAIT, or INPUT command is interrupted from the keyboard,the new variable \v(kbchar) contains a copy of the (first) character that wastyped and caused the interruption, provided it was not the command interruptcharacter (usually Ctrl-C). If these commands complete successfully or timeout without a keyboard interruption, the \v(kbchar) variable is empty.The \v(kbchar) variable (like any other variable) can be tested with: if defined \v(kbchar) <command>The <command> is executed if the variable is not empty.The \v(kbchar) variable can be reset with WAIT 0 (PAUSE 0, SL
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -