📄 ckermit.ini
字号:
#!/usr/local/bin/kermitCOMMENT - Standard C-Kermit initialization file;; For C-Kermit Version: 7.0.196 (but can also be used by 6.0.192);; Filename:; .kermrc (UNIX, OS-9, Aegis); CKERMIT.INI (OS/2, VMS, OpenVMS, AOS/VS, Atari ST, Commodore Amiga); ckermit.ini (Stratus VOS); K95.INI (Kermit 95 -- but this big version is not used there); K2.INI (Kermit/2 -- but ditto);; Authors:; Frank da Cruz, Christine M. Gianone, Jeffrey Altman; Columbia University, New York, NY 10025-7799, USA;; Version 5A(188): 23 November 1992; Version 5A(189): 29 June 1993; Version 5A(190): 04 October 1994; Version 5A(191): 17 April 1995; Version 6.0.192: 6 September 1996; Version 7.0.196: 1 January 2000;; This is the standard and recommended C-Kermit 7.0 initialization file. To; override settings or definitions made in this file, to add new settings or; definitions, or to make any other desired customizations, create a separate,; personal customization file called:;; .mykermrc (UNIX, OS-9, Aegis, BeBox, Plan 9); CKERMOD.INI (OS/2, VMS, OpenVMS, AOS/VS, Atari ST, Commodore Amiga); ckermod.ini (VOS);; You can also define the customization filename in an environment; variable (logical name in VMS), CKERMOD, which takes precedence over; the names shown above.;; WHAT THIS FILE DOES:;; . The FULLSCREEN file transfer display is selected if it is available; . Defines your default dialing directory name:; .kdd for UNIX, OS-9 and Aegis; CKERMIT.KDD for other operating systems.; You can override this with the environment variable K_DIAL_DIRECTORY; . Defines your default network directory name:; .knd for UNIX, OS-9 and Aegis; CKERMIT.KND for other operating systems.; You can override this with the environment variable K_NET_DIRECTORY; . Defines your default services directory name:; .ksd for UNIX, OS-9 and Aegis; CKERMIT.KSD for other operating systems.; You can override this with environment variable K_SERVICE_DIRECTORY.; . Defines your customization file name (name given above); . Performs system-dependent setups for UNIX, VMS, OS/2, etc.; . Defines an EDIT macro to let you invoke a text editor from C-Kermit.; . Defines TSEND, BSEND, TGET, BGET macros for text and binary file transfer.; . Defines VTPRINT, PCGET, and PCSEND macros for use with MS-DOS Kermit, etc.; . Opens your dialing directory if you have one.; . Reads your services directory and defines ACCESS and LIST macros for it.; . Executes your personal customization file, if you have one.;; C-Kermit 6.0 is documented in the book "Using C-Kermit", 2nd Edition,; by Frank da Cruz and Christine M. Gianone, 1997, Digital Press /; Butterworth-Heinemann, ISBN 1-55558-164-1. Updates are described in the; text file, ckermit2.txt.; Everything after this point depends on the script programming language.; The CHECK command terminates this command file immediately if the script; programming language (IF command) is not configured.;set take error on ; This makes CHECK quit if no script language.check if ; Do we have an IF command? If not, quit now.set take error off ; Back to normal.local _sd _servicedir _xp ; Declare local variables.COMMENT - C-Kermit version 6.0 or later required.;asg _xp \v(xprogram)if not def _xp asg _xp \v(program)if not equal "\m(_xp)" "C-Kermit" - stop 1 \v(cmdfile): This initialization file is only for C-Kermit.echo Executing \v(cmdfile) for \v(system)...if < \v(version) 60000 - stop 1 \v(cmdfile): C-Kermit 6.0 or later required.forward \v(system) ; First do system-dependent items...:unknown ; Should not happenStop 1 Error: System type unknown!:Aegis ; Apollo Aegis and:UNIX ; UNIX, all versionsasg _myinit - \v(home).mykermrc ; Customization filenameif remote forward COMMON ; Skip local-mode items if "-R"asg _dialdir - \v(home).kdd ; C-Kermit dialing directoryasg _netdir - \v(home).knd ; C-Kermit network directoryasg _servicedir - \v(home).ksd ; C-Kermit services directoryif \findex(IRIX,\v(platform)) - set send packet-length 4000 ; Bug in IRIX Telnet server.forward COMMON ; End of UNIX section:OS9/68K ; OS-9asg _myinit - \v(home).mykermrc ; Customization filenameif remote forward COMMONasg _dialdir - \v(home).kdd ; C-Kermit dialing directoryasg _netdir - \v(home).knd ; C-Kermit network directoryasg _servicedir - \v(home).ksd ; C-Kermit services directoryif eq "\$(TERM)" "vt100" - ; File transfer display set file display full ; Only works with VT-100 terminal typeelse if eq "\$(TERM)" "VT100" - set file display fullelse set file display crtforward COMMON ; End of OS-9 section:VMS ; VMS and OpenVMSforward COMMON:OS/2 ; Kermit 95:WIN32echo This initialization file is not for use with K95.forward COMMON ; End of OS/2 section:AOS/VS ; Data General AOS/VSset window 1 ; Sliding windows don't workset file char dg-international ; File character-setset xfer char latin1 ; Transfer character-setset file display crt ; File transfer fisplaydef cli push ; Escape to CLIdef reset - ; Macro to reset DG DASHER terminal run write [!ascii 236 306 301]forward COMMON ; End of AOS/VS section:Amiga ; Commodore Amigadef cls echo \27[H\27[2J ; CLS command to clear the screenset file display full ; Supports fullscreen displayset file char latin1 ; Use Latin Alphabet 1 for file transferset xfer char latin1 ; ...forward COMMON ; End of Amiga section:Atari_ST ; Atari STdef cls echo \27H\27J ; Clear screen a`la VT52set file display crt ; FULLSCREEN not availableset server display on ; Show file xfer display in server mode tooset server timeout 15 ; Nonzero required for ^C interruption!forward COMMON ; End of Atari ST section:Macintosh ; Apple Macintoshset server display on ; Show file xfer display in server mode too.forward COMMON:Stratus_VOS ; Stratus VOSasg _myinit \v(home)ckermod.iniif remote forward COMMONasg _dialdir \v(home)ckermit.kddasg _netdir \v(home)ckermit.kndasg _servicedir \v(home)ckermit.ksdset file display crt ; FULLSCREEN not availableforward COMMON ; End of Stratus VOS section:COMMON ; For all systems; Define macros that are useful when running C-Kermit in remote mode.; These macros serve no purpose on local-mode-only versions such as; OS/2, Macintosh, Amiga, and Atari ST Kermit, so we skip defining them; for those systems.;if not = 0 \findex(\v(system),WIN32:OS/2:Macintosh:Amiga:Atari_ST) - forward files; VTPRINT macro. Print a file on your PC's local printer.def VTPRINT echo \27[5i, type \%1, echo \27[4i; or if your printer needs a formfeed to force the page out:; def VTPRINT def echo \27[5i, type \%1, echo \12\27[4i; Macros for host-initiated file transfer using APC:; NOT NEEDED ANY MORE because of autodownload/autoupload.; Remove the following FORWARD command to reinstate these definitions::FILES; Get customization and directory file names. Environment variables take; precedence, so you do not have to edit this file to change these filenames.;if def \$(CKERMOD) assign _myinit \$(CKERMOD)if not def _myinit assign _myinit \v(home)CKERMOD.INIif remote forward CUSTOM ; Skip all this if -R given on command lineif def \$(K_NET_DIRECTORY) assign _netdir \$(K_NET_DIRECTORY)if not def _netdir assign _netdir \v(home)CKERMIT.KNDif def \$(K_DIAL_DIRECTORY) assign _dialdir \$(K_DIAL_DIRECTORY)if not def _dialdir assign _dialdir \v(home)CKERMIT.KDDCHECK DIAL ; Is there a DIAL command?xif fail { ; No. echo DIAL disabled forward CUSTOM}CHECK NETWORKxif success { xif exist \m(_netdir) { set net directory \m(_netdir) echo { Network directory is \m(_netdir) } }}if eq "\v(name)" "telnet" forward CUSTOMxif exist \m(_dialdir) { set dial directory \m(_dialdir) echo { Dial directory is \m(_dialdir) }}COMMENT - Services directoryif def \$(K_SERVICE_DIRECTORY) assign _servicedir \$(K_SERVICE_DIRECTORY)if not def _servicedir assign _servicedir \v(home)CKERMIT.KSDif not exist \m(_servicedir) forward connectionecho { Services directory is \m(_servicedir)}def MAX_SVCS 200 ; Adjust this if you have more entriesdefine _sd 0 ; Assume no services directoryopen read \m(_servicedir) ; Try to open services directory filexif success { declare \&d[\m(MAX_SVCS)] ; It's open, declare directory array for \%i 1 \m(MAX_SVCS) 1 { ; Read the lines into the array read \&d[\%i] if fail break } close read xif > \%i \m(MAX_SVCS) { echo Too many entries in services directory echo { Maximum is \m(MAX_SVCS).} echo { Change definition of MAX_SVCS in \v(cmdfile) to allow more. } echo { Services directory disabled.} } else { asg \&d[0] \feval(\%i - 1) define _sd 1 }}xif not \m(_sd) { def access echo { Services directory not available.} asg list \m(access)} else { def FIND { set case off for \%i 1 \&d[0] 1 { if eq {\%1} {\fsubstr(\&d[\%i],1,\flen(\%1))} break } if not > \%i \&d[0] return \&d[\%i] } def LIST { xif > \v(argc) 1 { find \%1 if def \v(return) echo \v(return) else echo \%1: Not found } else { echo \&d[0] items in services directory: for \%i 1 \&d[0] 1 { echo \fcont(\&d[\%i]) } } } def SPLIT { asg _word1 \%1, asg _word2 \%2 } def DOACCESS { ; (Used internally by ACCESS macro) do \%5 \%6 \%7 \%8 \%9 ; Do the connection macro if fail end 1 split \%3 ; Get words from \%3 asg \%3 \m(_word1) asg \%2 \m(_word2) do \%3 \%4 {\%1} \%2 ; Login macro, userid, password, prompt } def ACCESS { if not defined \%1 end 1 access what? ; Check service find \%1 ; Look it up if success doaccess {\%2} \v(return) ; OK, try it else end 1 "\%1" not in services directory ; Not found if fail end 1 ; DOACCESS failed? xif eq \v(cmdlevel) 1 { echo echo ACCESS: Login succeeded - CONNECTing... show escape output \13 connect /quietly } }}:CONNECTION ; Macros for making connectionsCOMMENT - SERIAL macro. Arguments:; \%1 = device name; \%2 = speed;def SERIAL { if < \v(argc) 3 ; All arguments given? end 1 Usage: SERIAL device speed ; No. set line \%1 ; OK, try to SET LINE. if failure - ; If this failed, end 1 Can't open device: \%1 ; print message and quit. set speed \%2 ; Try to set the speed. if fail end 1 Unsupported speed: \%2 ; Failed. echo Connection successful. ; Succeeded.}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -