📄 xc.nro
字号:
respectively set the modem port to a character size of 8 with no parity, or acharacter size of 7 with either even or odd parity. During B-Plus or XMODEMtransfers, the port protocol is set to 8N, and reverts to its prior settingthereafter.T}set xcape \fIchar\fRset escape \fIchar\fR@T{Set the \fBXCAPE\fR character (see below) to \fIchar\fR. This should be set tosome non-printing character (other than backspace, tab, newline, of course).The character may be entered by depressing the Control key firstand then typing a letter, or by typing a carat (^) followed by a letter.T}set xon on|offset xoff on|off@T{Set XON/XOFF flow control flag. If "on", the program will honor the XOFFcontrol character and wait until an XON character is received beforetransmitting any more information. If "off", the program will ignoreXOFF/XON requests. You probably want this set 'off' if you have rts/ctsflow control enabled. See next entry.T}set rtscts on|off@T{Enable your comm port to use hardware flow control. If you select thisoption, you must also tell your modem to use rts/cts too. See your modem manual for details. Generally, this is the preferred method offlow control.T}set del2bs on|off@T{Because the Linux backspace key does not actually send the backspacecharacter but '\177' (delete character) instead, XC can trap it andtranslate it to its proper value if you issue the command "set del2bson". If you issue the command "set del2bs off", the backspace keywill echo '\177' the DEL character. Normally this is only of interestwhen connecting to a VAX machine which usually prefers the deletecharacter. Most public dial-in services and BBS prefer the backspacecharcter (^H). Enable this by 'set del2bs on'.T}set msdos on|off@T{Sets translation of ASCII characters from the MS-DOS screen codes toLINUX screen codes. Set this mode "on" when connected to DOS BBSs.Note that LINUX does not support all the special characters andsymbols available under MS-DOS. Where no exact match is avail- able,the best possible substitution is made. Note that under LINUX thatspecial characters can be typed by holding down the <alt> key andtyping another regular key. For example, typing <alt> <i> on a USkeyboard will produce an accented e', <alt> <I> will produced anaccented E'.T}set autozm on|off@T{This option enables or disables the automatic receptionof files via the ZMODEM protocol. You must also set theproper command string using the 'zmcmd' option below.T}set zmcmd command@T{Use this option to specify the command line used when xc automatically invokes your external ZMODEMreceive protocol, for example "set zmcmd rz -v".T}.TE.SS \fITerminal Mode\fRIn terminal mode, all characters typed at the keyboard are sent to themodem, except that newline characters (0x0A) are translated tocarriage-returns (0x0D) when you have "set nl 'on'"; all characters receivedfrom the modem are displayed on the local terminal screen.\fBXCAPE\fR is a key that will, when typed in terminal mode, introduce an.B xc"escape" command. Don't confuse \fBXCAPE\fR with the <ESCAPE> key.The default definition for \fBXCAPE\fR is ASCII 1, or Control-A. It can be redefined at run time with the "set escape \fIC\fR" command (or it can beredefined in the.I .xcstartup script).When the \fBXCAPE\fR key is typed in terminal mode, the program will examinethe next key pressed. If this key has been "bound" to perform a certainfunction, that function will be performed; otherwise, the second character issent to the modem. Thus, to send the \fBXCAPE\fR character through the modem,it is necessary to press the key TWICE.Thus the ESCAPE key itself would be a terrible choice for \fBXCAPE\fR, becauseit is used so often by other programs: if you were logged into a remote systemand running, say, \fBvi\fR, it would be a great annoyance to have to hit ESCAPEtwice to get it transmitted once.The following keys (case \fIin\fRsensitive) are bound at startup time. Othersmay be added through the binding commands available in .B xcscripts..TStab(@) ;l2 l2 ll2B l2 l .Command@Function@DescriptionXCAPE /@Help@Display the table of bound keysXCAPE ?@Help@Display the table of bound keysXCAPE b@\fIB\fRREAK@Send a MODEM BREAK signal (a sustained null).XCAPE d@\fID\fRirectory@Display the phone directory.XCAPE f@\fIF\fRile@Send a file through the modem (ASCII transfer).XCAPE s@\fIS\fRcript@\fBXc\fR will request the name of a script to execute.XCAPE h@\fIH\fRangup@Tell the modem to go on-hook.XCAPE o\fR@Graphics \fIO\fRff@T{Clear vt102 graphics mode.If line noise or some other phenomenon puts you in graphics mode(weird characters being displayed instead of plain text), use thiscommand to toggle back to normal text mode. Note that previouslydiplayed text is unaffected. Only subsequent text will be affected.T}XCAPE y\fR@Capture \fIY\fRes@T{Open the capture file in APPEND mode (text received over the port accumulatesat the end of the file). If the file is already open, a message is printed tothat effect.T}XCAPE n\fR@Capture \fIN\fRo@T{Close the capture file. If it wasn't open, a message of regret is printed.T}XCAPE x\fR@e\fIX\fRit@Exit terminal mode back to \fI<XC>\fR command mode.XCAPE q@\fIQ\fRuit@Quit \fBxc\fR altogether..TE.SS \fIPhonelist\fR.B Xclooks for a.I phonelistfile in the following order: in the current directory, in your home directoryas defined by the $HOME environment variable, or in the LIBDIR as definedat compile time in.I xc.h.However in command mode, any filename can be substituted, using the SET PFILEcommand, so long as it has the following characteristics:It is ASCII text (lines of text separated by newlines).The first field of data in each line (after any whitespace and up to the nextoccurence of whitespace) is a phone number in a valid format forthe modem being used.Descriptive text may follow the phone number. Spaces may be included in thistext, but a <TAB> must terminate this text.The following three definitions may then follow in any order:.TP 12PROTO=sss(sss=7e2|7o2|8n1) Set the serial port protocol for 7-bit characters witheither even or odd parity and two stop bits, or for 8-bit characters withno parity and one stop bit..TPBPS=nnnn(n=300|1200|2400|9600|19200|38400) Set the bits/second rate to thespecified value..TPSCRIPT=fileImmediately after sending the autodial string, execute the script filespecified. (Note that the specified filename is CASE SENSITIVE!).PThe following definition, if used, must be the LAST field on the line.PREFIX=xxxxxxxx (e.g., PREFIX=ATs110=0s111=0)The PREFIX="string" allows you send your modem a different setup string foreach situation (default: no special setup). This is helpful for MNP and Telebitmodems which require special attention for contacting non-MNP modems and otherTelebits..SS \fIScripts\fRThe.B xcscript language is intended to be closely similar to the Unix Bourne shelllanguage. Unfortunately, it isn't identical to the Bourne shell, so it hasthe same problem that the.BR awk (C)program does for those experienced in the C language: an.B awkscript LOOKS like C, but it isn't, really; and in the same way, an.B xcscript LOOKS like a Bourne shell script, but isn't. So the operation of theBourne shell, if you're familiar with it, is useful as an analogy inunderstanding the.B xcscript language, but only as an analogy.An.B xcscript consists of lists of commands. Commands are set off from each otherwithin a list by either a newline ('\\n') or a semicolon (;), as is the casewith the Bourne shell. The semicolon and the newline have identical effect ascommand separators, so (anticipating a bit here) you could say either.nf if counter morethan 5 then transmit "bye^M" quit endifor if counter morethan 5; then transmit "bye^M"; quit; endif.fiand the result will be the same either way. The newline and the semicolonare treated the same way as in the Bourne shell, except that a newline cannotbe quoted so as to remove its interpretation as a command terminator (inother words, a quoted string cannot contain a newline).Commands are composed of.IR word sseparated by spaces or tab characters, and a.I wordcan be one of the following:.TP 3*One of the.B xcscript language keywords, which are listed below, with appropriate explanations..TP*A number, meaning a sequence consisting only of digits, withan optional leading minus sign to indicate a negative number..TP*A literal string of characters surrounded by double-quotation marks ('"'); sucha string can be no longer than 80 characters. A double-quotation mark can beimbedded within the string by preceding it with a backslash ('\\"'); when thestring is interpreted, the backslash is disregarded and the double-quotationmark is treated as part of the string. Mismatched quotation marks result in asyntax error..TP*The name of a user variable, which can have either a string or a numeric value.The name of a user variable must begin with an alphabetic character..TP*The name of a shell environment variable, preceded by a dollar sign ('$'). The.B xcscript language examines the Unix environment for the specified variable and,if such a variable exists, substitutes the value of that variable. The resultis treated as if it were a quoted literal string, and, therefore, should not bemore than 80 charac\%ters long, or else it will be truncated to its first 80characters. Similarly, such an environment variable should not contain anewline..TP*An expression surrounded by back-quotation marks ('`'). This sort of expressionoperates similarly to the Bourne shell's command-substi\%tution mechanism: thecontents of the back-quotes are passed to the Bourne shell, and the standardoutput of the back-quoted command is treated as if it were a quoted literalstring. Therefore, the command's output should not be more than 80 characterslong, nor contain a newline. Also, the contents of the back-quotes cannot belonger than 80 characters, nor contain a newline..TP*An expression introduced by a pound-sign (or number-sign: '#'), which istreated as a comment. All characters from the '#' until the end of thephysical line are ignored. This comment mechanism is the same as in theBourne shell..TP*A limitation of the script language is that only one character string can bepassed as an argument to any of the script commands. The \fIbind_function\fR,\fIbind_script\fR, and \fIbind_string\fR commands thus need to use a decimaldigit to represent the key that is to be bound. The ASCII value of the the keyis employed. As an example, Control-C is identified as 3, Control-Z is 26, theESCAPE key is 27, a space is 32, the number "1" is 49; letters are.RI case- in sensitiveso that identifying the bound key as "65" or as "97" will always bind .I both "a" and "A" to the same command..PQuoted literal strings (and the two other mechanisms that act like quotedliteral strings, shell environment variables and back-quoted shell commands)may be up to 80 characters long. All other words must be no longer than 16characters, and are treated case-independently (which is to say, uppercaseis the same as lowercase); note, though, that the names of shell environmentvariables are case-dependent (uppercase must match uppercase and lowercasemust match lowercase), because they are case-dependent in the shell.Any word not recognizable within the foregoing categories is treated as thename of a new user variable. Such a word, if longer than 16 characters, isconsidered to be a syntax error.User variables are created with the 'assign' script keyword, and may haveeither numeric or string values. The type of a user variable is determinedby how it's created; if it's assigned to a string, it's a string variable,and if it's assigned to a number, it's a numeric variable. The value of anyuser variable can be changed with another 'assign' command, and numericvariables can be changed to string variables and vice-versa. Shellenvironment variables cannot be changed within an.B xcscript, but the value of a shell environment variable can be assigned to a uservariable, and the value of the user variable can thereafter be changed.Scripts are contained in ASCII text disk files, one script to a file. Ascript can invoke another script as a subroutine with the 'call' keyword; upto 5 scripts can be nested in this way at any single time.With all this said, the following list of.B xcscript language commands should be comprehensible. The format "<something>"means that a token, or word-type, of the "something" type is meant rather thanthe literal sequence 'something'..SS \fIScript Language Commands\fRNote that all the commands are case-\fIin\fRsensitive!.TP 4.I affirmSyntax: affirmReads a string from the terminal, and returns TRUE if the string begins with\&'y' or 'Y'; otherwise, returns FALSE. Used in evaluating conditionalexpressions. The string must be terminated by a newline or carriage-return.Example: echo -n "Continue (y/n)? " if affirm then continue else break endif.TP.I assignSyntax: assign <varname> eq <number> assign <varname> eq "string" assign <varname1> eq <varname2> assign <varname> eq <script-command>Assigns to user variable <varname> the value following "eq"; if that value is anumber, then <varname> becomes a numeric user variable; if that value is astring, then <varname> becomes a string user variable. If <varname> does notalready exist as a user variable, it is created. Variable space is allocateddynamically, but running out of memory space for variables is unlikely. Allvariables are global across scripts that run at the same time via the 'call'keyword, and all variables vanish when a script, called directly from.B xcas opposed to called from another script, exits. In other words, variablevalues are not static except during 'call' execution. Variable names cannot belonger than 8 characters. Successive 'assigns' are permissible, and the type ofthe variable changes according to the type of the value following "eq". A uservariable is destroyed with the 'unassign' keyword.If a variable is assigned the value of a script command, then it becomes anumeric variable with value TRUE or FALSE, depending on the status returned bythe script command. If a variable is assigned the value of a back-quotedcommand, it becomes a string variable with the value of the first 80 charactersof the back-quoted command. If a variable is assigned equal to an environmentvariable, it becomes a string variable with the value of the first 80characters of the value of the environment variable.Examples: assign numvar eq 5 assign strvar eq "This variable is a string" assign mydir eq $HOME assign numvar2 eq numvar assign strvar2 eq strvar assign numvar eq true assign today eq `date`; echo "today is " today.TP.I beepSyntax: beepSends a Control-G to the terminal. Useful for alerting the user that some eventhas occurred, for example a CONNECT after a lengthy redialing session..TP.I bind_functionSyntax: bind_function \fIcode\fR "function"Bind the character identified by the number specified by \fIcode\fR to the\fBxc\fR builtin function "function".The "function" may be one of the following (case is ignored): BRKCHAR Send modem BREAK signal CAPTEND Turn off terminal mode capture CAPTYES Turn on terminal mode capture DIALCHR Dial from phonelist DIVCHAR Send file through modem DOSCRPT Execute script file (prompts interactively) EMITSTR Emit string ENDCHAR Exit terminal mode HLPCHAR Display terminal mode key bindings HUPCHAR Hang up modem QUITCHR Quit program SCRPCHR Prompt for script fileExample:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -