📄 ckuker.nr
字号:
to SET FILE COLLISION OVERWRITE..TP-x(ACTION) Enter server mode. Equivalent to the SERVER command.Also see: -O..TP-y argAlternative initialization file.Argument: Filename..TP-zForce foreground behavior. To be used in case Kermitdoesn't automatically sense its foreground status.Equivalent to the SET BACKGROUND OFF command..PPExtended command-line options (necessary because single-letter ones areabout used up) start with two dashes (--), with words rather than singleletters as option names. If an extended option takes an argument, it isseparated from the option word by a colon (:). Extended options include:.TP --bannerfile:filenameFile to display upon startup or IKSD login..TP --cdfile:filenameFile to be sent for display to the client whenserver changes directory (filename is relative tothe changed-to directory)..TP --cdmessage:{on,off}Enable/disable the server CD message feature..TP --helpPrints usage message for extended options..TP --helpfile:filenameDesignates a file containing custom text toreplace the top-level HELP command..TP --nointerruptsDisables keyboard interrupts..TP --nopermsDisables the Kermit protocol file Permissionsattribute, to prevent transmission of filepermissions (protection) from sender to receiver..TP --version(ACTION) C-Kermit prints its version number..PPPlus several other IKSD-Only options described at:.PP http://www.columbia.edu/kermit/iksd.html.PPSee the file-transfer section for examples of command-line invocation..SH COMMAND LANGUAGEC-Kermit's interactive command language is the subject of a 622-page bookand another several hundred pages of updates, far too much for a manualpage. But it's not hard to get started. At the shell prompt, just type"kermit" to get C-Kermit's interactive command prompt:.PP.nf $ kermit (/current/directory) C-Kermit>.fi.PPBegin by typing "help" (and then press the Return or Enter key) for atop-level overview, read it, and go from there. Your second command shouldprobably be "intro" (introduction). Note the prompt shows your currentdirectory (unless you tell Kermit to prompt you with something else)..PPInteractive commands are composed mainly of regular English words, usuallyin the form of imperative sentences, such as:.PP send oofa.txt.PPwhich tells Kermit to send (transfer) the file whose name is oofa.txt, or:.PP set transfer mode automatic.PPwhich sets Kermit's "transfer mode" to "automatic" (whatever that means)..PPWhile typing commands, you can abbreviate, ask for help (by pressing the"?" key anywhere in a command), complete keywords or filenames (with theTab or Esc key), and edit your typing with Backspace or Delete, Ctrl-W,Ctrl-U, etc. You can also recall previous commands, save your commandhistory, and who knows what else. Give the INTRO command for details..PPC-Kermit has hundreds of commands, and they can be issued in infinitevariety and combinations, including commands for:.nf.PP\(bu Making connections (SET LINE, DIAL, TELNET, SSH, FTP, ...).br\(bu Breaking connections (HANGUP, CLOSE).br\(bu Transferring files (SEND, GET, RECEIVE, MOVE, RESEND, ...).br\(bu Establishing preferences (SET).br\(bu Displaying preferences (SHOW).br\(bu Managing local files (CD, DELETE, MKDIR, DIR, RENAME, TYPE, ...).br\(bu Managing remote files (RCD, RDEL, RMKDIR, RDIR, ...).br\(bu Using local files (FOPEN, FCLOSE, FREAD, FWRITE).br\(bu Programming (TAKE, DEFINE, IF, FOR, WHILE, SWITCH, DECLARE, ...).br\(bu Interacting with the user (ECHO, ASK, ...).br\(bu Interacting with a remote computer (INPUT, OUTPUT, ...).br\(bu Interacting with local programs (RUN, EXEC, PTY, ...).br\(bu Logging things (LOG SESSION, LOG PACKETS, LOG DEBUG, ...).PP.fiAnd of course QUIT or EXIT to get out and HELP to get help, and forprogrammers: loops, decision making, variables, arrays, associative arrays,integer and floating point arithmetic, macros, built-in and user-definedfunctions, string manipulation, pattern matching, block structure, scoping,recursion, and all the rest. To get a list of all C-Kermit's commands, typea question mark (?) at the prompt. To get a description of any command,type HELP followed by the name of the command, for example:.PP help send.PPThe command interruption character is Ctrl-C (hold down the Ctrl key andpress the C key)..PPThe command language "escape character", used to introduce variable names,function invocations, and so on, is backslash (\). If you need to include aliteral backslash in a command, type two of them, e.g.:.PP get c:\ek95\ek95custom.ini.SS Command Files, Macros, and ScriptsA file containing Kermit commands is called a Kermit command file or Kermitscript. It can be executed with Kermit's TAKE command:.PP (/current/dir) C-Kermit> take commandfile.PP(where "commandfile" is the name of the command file). Please don't pipe acommand file into Kermit's standard input (which might or might not work);if you have Kermit commands in a file, tell Kermit to TAKE the file..PPIn Unix only, a Kermit command file can also be executed directly byincluding a "kerbang" line as the first line of the file:.PP #!/usr/local/bin/kermit +.PPThat is, a top line that starts with "#!", followed immediately by the fullpath of the Kermit executable, and then, if the Kermit script is to begiven arguments on the command line, a space and a plus sign. The scriptfile must also have execute permission:.PP chmod +x commandfile.PPExcept for the " +" part, this is exactly the same as you would do for ashell script, a Perl script, etc. Here's a simple but useless examplescript that regurgitates its arguments (up to three of them):.PP #!/usr/local/bin/kermit + if defined \e%1 echo "Argument 1: \e%1" if defined \e%2 echo "Argument 2: \e%2" if defined \e%3 echo "Argument 3: \e%3" if defined \e%4 echo "etc..." exit.PPIf this file is stored in your current directory as "commandfile", then:.PP ./commandfile one two three four five.PPprints:.PP Argument 1: one Argument 2: two Argument 3: three etc....PPThis illustrates the basic structure of a standalone Kermit script: the"kerbang line", then some commands. It should end with "exit" unless youwant the Kermit prompt to appear when it is finished. \e%1 is the firstargument, \e%2 the second, and so on..PPYou can also create your own commands by defining named macros composed ofother Kermit commands (or macros). For example:.PP.nf define mydelete { local trash assign trash \ev(home)trashcan/ if not defined \e%1 end 1 "Delete what?" if wild \e%1 { end 1 "Deleting multiple files is too scary" } if not exist \e%1 end 1 "I can't find \e%1" if not directory \em(trash) { mkdir \em(trash) if fail end 1 "No trash can" } rename /list \e%1 \em(trash) } define myundelete { local trash assign trash \ev(home)trashcan/ if not defined \e%1 end 1 "Undelete what?" if wild \e%1 { end 1 "Undeleting multiple files is too hard" } if not directory \em(trash) end 1 "No trash can" if not exist \em(trash)\e%1 { end 1 "I can't find \e%1 in trash can" } rename /list \em(trash)\e%1 . }.PP.fiThese sample macros are not exactly production quality (they don't handlefilenames that include path segments, they don't handle multiple files,etc), but you get the idea: you can pass arguments to macros, and they cancheck them and make other kinds of decisions. If you put the above linesinto your initialization or customization file (explained below), you'llhave MYDELETE and MYUNDELETE commands available every time you startKermit, at least as long as you don't suppress execution of theinitialization file. (Exercise for the reader: Make these macros generallyuseful: remove limitations, add trashcan display, browsing, emptying, etc.).PPKerbang scripts execute without the initialization file. This to keep themportable and also to make them start faster. If you want to write Kerbangscripts that depend on the initialization file, include the command.PP take \ev(home).kermrc.PPat the desired spot in the script. By the way, \ev(xxx) is a built-invariable (xxx is the variable name, "home" in this case). To see whatbuilt-in variables are available, type "show variables" at the C-Kermitprompt. To see what else you can show, type "show ?". \em(xxx) is a userdefined variable (strictly speaking, it is a macro used as a variable)..SS Command ListC-Kermit has more than 200 top-level commands, and some of these, such asSET, branch off into hundreds of subcommands of their own, so it's notpractical to describe them all here. Instead, here's a concise list of themost commonly used top-level commands, grouped by category. To learn abouteach command, type "help" followed by the command name, e.g. "help set".Terms such as Command state and Connect state are explained in subsequentsections..PPOptional fields are shown in [ brackets ]. "filename" means thename of a single file. filespec means a file specification that is allowedto contain wildcard characters like '*' to match groups of files. optionsare (optional) switches like /PAGE, /NOPAGE, /QUIET, etc, listed in theHELP text for each command. Example:.PP.nf send /recursive /larger:10000 /after:-1week /except:*.txt *.fi.PPwhich can be read as "send all the files in this directory and all the onesunderneath it that are larger than 10000 bytes, no more than one week old,and whose names don't end with ".txt"..SSBasic Commands.RS.TPHELPRequests top-level help..TPHELP commandRequests help about the given command..TPINTRODUCTIONRequests a brief introduction to C-Kermit..TPLICENSEDisplays the C-Kermit software copyright and license..TPVERSIONDisplays C-Kermit's version number..TPEXIT [ number ]Exits from Kermit with the givenstatus code. Synonyms: QUIT, E, Q..TPTAKE filename [ parameters... ]Executes commands from the given.TPLOG item [ filename ]Keeps a log of the given item in the given file..TP[ DO ] macro [ parameters... ]Executes commands from the given macro..TPSET parameter valueSets the given parameter to the given value..TPSHOW categoryShows settings in a given category..TPSTATUSTells whether previous command succeeded or failed..TPDATE [ date-and/or-time ]Shows current date-time or interprets given date-time..TPRUN [ extern-command [ parameters... ] Runs the given external command. Synonym: !..TPEXEC [ extern-command [ params... ]Kermit overlays itself with the given command..TPSUSPENDStops Kermit and puts it in the background. Synonym: Z..RE.SSLocal File Management.RS.TPTYPE [ options ] filenameDisplays the contents of the given file..TPMORE [ options ] filename Equivalent to TYPE /PAGE (pause after each screenful)..TPCAT [ options ] filename Equivalent to TYPE /NOPAGE..TPHEAD [ options ] filename Displays the first few lines of a given file..TPTAIL [ options ] filename Displays the last few lines of a given file..TPGREP [ options ] pattern filespecDisplays lines from files that matchthe pattern. Synonym: FIND..TPDIRECTORY [ options ] [filespec ]Lists files (built-in, many options)..TPLS [ options ] [ filespec ] Lists files (runs external "ls" command)..TPDELETE [ options ] [ filespec ]Deletes files. Synonym: RM..TPPURGE [ options ] [ filespec ]Removes backup (*.~n~) files..TPCOPY [ options ] [ filespecs... ]Copies files. Synonym: CP..TPRENAME [ options ] [ filespecs... ]Renames files. Synonym: MV..TPCHMOD [ options ] [ filespecs... ]Changes permissions of files..TPTRANSLATE filename charsets [ filename ]Converts file's character set. Synonym: XLATE..TPCDChanges your working directory to your home directory..TPCD directory
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -