⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 _p_cmd.txt

📁 一个通讯程序源码
💻 TXT
📖 第 1 页 / 共 4 页
字号:
.*s 1 "Commands".*s 2 "autorz"usage: autorz [off | on]ECU in the interactive mode (no procedure executing) can interpret aSUB, 'B', '0', '0' receive data sequence as a ZMODEM ZRQINIT frame andautomatically begin a ZMODEM receive operation.  This command controlsthis feature.  By default, this feature is turned on..*s 2 "baud"usage: baud <baud-int>This command sets the baud rate for the attached line.The integer argument <baud-int> must be one of110, 300, 600, 1200, 2400, 4800, 9600, 19200 and 38400.Using the 'baud' procedure command in the ECU initializationprocedure "_rc.ep" serves as an exact analog of the -b command.  The.B baudcommand with the.B setlinecommand gives you programatic control over the actual choice of theline and rate or the defaults for the setup screen, depending uponother options.  NOTE: using the baud command in _rc.ep will overrideany command line -b specification..DS LExample:    baud 9600    set $i0=2400; baud $i0.DE.*s 2 "break"usage: breakThis command is used inside a.B whileior.B whilescompound statement to exit the loop.This is not to be confused with the interactive command"break" when sends an asynchronous BREAK signal.  Use the procedurecommand .B lbreakfor this purpose..DS LExample:    whilei 1=1 #forever unless break command executed    {        echo -n 'Answer yes or no: '        set $s0=%cgets # get answer        ifi %instr($s0,'y') == 0 set $i0 = 1; break        ifi %instr($s0,'n') == 0 set $i0 = 0; break        # got neither 'y' nor 'n' ... keep trying    }    # now $i0 = 1 if yes, 0 if no.DENOTE: further examples of.B breakusage may be found in the example for theelsecommand..*s 2 "cd"usage: cd <directory-path>This command changes ECU's current working directory.The string argument <directory-path> may contain anydirectory pathname specification legal to be submitted tothe shell csh.  Wild card characters may be used, providedthe expansion produces only one pathname..DS LExample:    cd '~user/bin'    cd %envvar('HOME')+'/bin'.DE.*s 2 "clrx"usage: clrxThis command clears  the attached line's transmitter XOFF state.Issuing the command is the equivalent to receiving an XON fromthe remote system..*s 2 "cls"usage: clsThis command clears the screen..*s 2 "color".DS Lusage: color <normal-foreground> [<normal-background>]usage: color -r <reverse-foreground> [<reverse-background>].DEThis command changes the current normal or reverse video colors in amanner similar to the setcolor(C) command.  It has no effect on systemsusing other than an SCO multiscreen color monitor.  If the second (background) color isomitted, it is assumed to be black.The command also forces normal video mode.  Refer to the.B vidnormand.B vidrevcommands.Refer also to the.B vidcolorcommand..DS LColor names   blue      magenta      brown      black   lt_blue   lt_magenta   yellow     gray   cyan      white        green      red   lt_cyan   hi_white     lt_green   lt_red.DE.DS LExample:    color lt_green  # normal video light green on black    color -r red white # reverse video red on white.DE.*s 2 "continue"usage: continueThis command is used inside a.B whileior.B whilescompound statement to skip the remainder of anycommands in the loop and continue execution at the firstcommand in the loop..DS LExample:    send '' # send ENTER to get prompt    whilei 1=1 # forever unless break command executed    {        lookfor -e 'login: ' # look for login prompt        ifi $i0 == 0         # if we dont get prompt ...        {            send ''          # send ENTER again            continue         # and look for login prompt        }        send $s_name         # send username        lookfor -e 'Password:'        send $s_password        get -e 0 50          # wait 10 seconds for response        # if incorrect not found in response, ...        if %instr($s0,'incorrect') < 0 # ... must have won            break        # garbled line?: system will send another 'login: '    }.DENOTE: further examples of.B continueusage may be found in the example for the.B elsecommand..*s 2 "conxon".DS Lusage: conxon [<arg>]where <arg> is on    honor ^S/^Q local flow control (DEFAULT)               off   pass ^S/^Q to remote.DEThis command enables or disables console xon/xoff flow control.If the argument is omitted, the current flow control state is displayed.If on, typing ^S/^Q stops or restarts the local console driveroutput.  If off, ^S and ^Q are passed to the remote (for EMACS,of course -- who else?)..*s 2 "cursor"usage: cursor <row> [<col>]This command places the cursor at a specified position onthe video screen.  The top left of the scrren is row 0, column 0.If <col> is not specified, it is assumed 0 (left margin)..DS LExample:    cls    $i0 = 5    whilei $i5 < 12    {        cursor $i5        echo 'This is line '+%itos($i5,2d)+' of the display'    }.DE.*s 2 "dcdwatch"usage: dcdwatch [<dcdwatch-param>]This command controls the DCD watcher.  The optional argument may be:.DS L   y or yes         enable DCD watcher   n or no          disable DCD watcher   t or terminate   terminate ECU on loss of DCD.DEThe DCD watcher when enabled causes ECU to monitor the DCD line(within the limits imposed by the OS with its CLOCAL=0 functionality).When the watcher is on and DCD drops, ecu automatically performsthe action of the interactive or procedure.B hangupcommand.  If the 't'erminate option is chosen, then afterhangup processing is complete, the ECU program will terminate.  The state of the watcher may be changed by the use of the dialcommand which uses a directory entry which changes theDCD watcher status.The DCD watcher depends upon the tty driver to return zero characterson a read when DCD is low when the termio flag CLOCAL is reset.The tty driver must ignore DCD if CLOCAL is set.If your system offers a "modem" and "direct" choice (by choiceof filename), you probably need to use the "modem" choice forthis to work properly.  This decision is made properly for youon SCO if you are using SCO "standard" tty linenaming conventions.  This is true even though ECU appears to forcea tty name with trailing upper case characters (modem) to one with a lower case character (direct)..*s 2 "delline"usage: dellineThis command deletes the current line from the video display..*s 2 "dial"usage: dial <remote>This command causes an outgoing call to be placed.  The stringargument <remote> can take one of two forms: a numeric telephonenumber or an alphanumeric "logical" number or system name.A numeric phone number ('1(800)555-1212' or '2345678') must beginwith a digit and must consist entirely of digits, parenthesesor hyphens.If a telephone number is supplied, the phone number isdialed; you must first have set the desired baud rate andparity using the 'baud' and 'parity' commands.(If the last character of a telephone number is a dollar sign,it is removed and is replaced with the contents of the first linein ~/.ecu/credit.  See the description of the dialing directory.)If a logical name is entered, the phone directory (managed bythe interactive.B dialcommand) is searched;if the entry is found, the baud rate and parityis automatically set from values in the directory entry; then,the number in the directory entry is dialed.Using the dial command with a directory entry may change the DCD watcher (dcdwatch) status.See the section on the.B dcdwatchcommand and the section titled "Choosing a Dialout Line" formore information.When the.B dialcommand returns, integer variable $i0 is set to a status codeand string variable $s0 has a text message (the modem verbalresult code if the ECU dialer is used, a representation ofthe return status code if a uucp dialer is used [see below])..DS L.BDial Command $i0 Status Codes.R    0  successful connect    1  failed to connect (call progress)    2  dial interrupted by signal    3  modem error (non responsive or commands rejected).DE.DS L.BDial Command $s0 Status Messages (uucp dialer).R    CONNECT ####           #### = baud rate    BUSY                   only some modems    NO ANSWER              only some modems    NO CARRIER             most generic "fail to connect"    NO DIAL TONE           only some modems    !Connect bad baud rate modem reported different rate    !Interrupted           call interrupted by signal    !Invalid arguments     ECU error    !Invalid phone number  too long or bad characters    !Ioctl error           should not be reported here    !Line in use           should not be reported here    !Line open error       should not be reported here    !Modem Error           modem did not respondNote: if the ECU dialer is used, the actual modem result codeis returned in $s0 or one of the following two strings:    !Interrupted           call interrupted by signal    !Modem Error           modem did not respond.DE.*s 2 "do"usage: do <procname> [<arg> ...]This command executes a procedure whose name appears as the command'sfirst (string) argument.  One or more arguments (up to 19) may be passedto the called procedure; an argument may consist of any valid stringexpression, provided, that, when expanded,  the argument does notexceed 256 characters in length.The called procedure may read its arguments using the.B %argvstring function.  %argv(0) is the name of the procedure.The quantity of arguments may be obtained using the.B %argcinteger function..DS LExample:    do 'proc' %rname %date+' '+%time %argv(0)Note: in this example, the called procedure is passed the nameof the calling procedure as the last argument..DE.*s 2 "duplex".DS Lusage: duplex full | half       duplex 'full' | 'half'.DEThis command specifies whether or not ECU is to locally echocharacters typed by you at the keyboard.  The overwhelmingmajority of remote systems provide the echo function, inwhich case full duplex must be used.  For the rare occasionswhen the remote system does not echo your keyboard input,setting half duplex will allow you to see what you aretyping.When communicating with another terminal in a "teletypeconversation", setting half duplex is generally required.In such cases, use of the interactive.B nl ,.B nlinand.B nloutcommands may also be required..DS LExample:    duplex full    $s0 = 'full'; duplex $s0.DE.*s 2 "echo"usage: echo [-n] <string>This command prints the contents of the string argument <string>on the screen.  If the -n switch is not present, a newline followsthe output of <string>..DS LExample:    echo 'Procedure '+%argv(0)+' executing at '+%time    echo -n 'Enter your first name: '; $s0 = %cgets.DE.*s 2 "eeol"usage: eeolThis command erases the video display to the end of the line..*s 2 "else".DS Lusage: else <statement>       else           <statement>       else       {            any kind and number of statements       }       else <if> <statement>       else <if>       {            any kind and number of statements       }.DEThis statement may follow an.B ifior.B ifs command to specify one or more statements to be executed ifthe if-type command condition is false.  Else commands may bechained together in the traditional structured language manner.For the purposes of describing this command, <statement> isany single or compound statement.B NOTcontaining a.B whileior.B whilescommand.If you wish to have a while-type command executed as part of an.B elsecondition, the while must occur within braces ("{}").<if> is an.B ifior.B ifscommand followed by an <if-condition> (see the description of the.B ifior.B ifscommands below)..DS LExample:#+------------------------------------------------------# finger.ep - procedure to send 'finger' to remote# BSD Unix system; print resulting lines in different# colors: uucp logins green, root red, others cyan#-------------------------------------------------------    mkvar $icolor; $icolor = %colors    mkvar $itimeout    $itimeout = 50     # timeout for first line 5 secs    send 'ps -aux'     # send command, but do not echo    lookfor '\en' 40    # swallow command    whilei 1==1        # forever, or until break    {        lgets 0 $itimeout 1 '\en' #get a line        ifi $i0 = 0 break #if no chaacters read        $itimeout = 10 #wait 1 sec for later lines        ifi %instr($s0,'% ') >= 0 # if csh prompt seen            break                 # exit while loop        else ifi %instr($s0,'Login') >= 0            color gray        else ifi %instr($s0,'root') >= 0            color red        else ifi %instr($s0,'uucp') >= 0            color green        else color cyan        echo $s0    }    icolor $icolor #restore entry colors    send ''        #force a new prompt from remote.DE.*s 2 "exec"usage: exec <string>This function executes a string as a procedure statement.Argument <string> must contain an ecu statement exactly asmight appear on a procedure line, with a few exceptions..DS L1. There may be no label: the first command may    start in column one.2. You should not execute a goto, gosub or return.3. You should not code if, while or compound statement   brackets..DEYou are on your honor with regard to items 2 and 3 above.If you stretch it, it will break..DS LExample:    $s20 = 'Home';   $s30 = '^H'     $s21 = 'End';    $s31 = '^E'    $s22 = 'F1';     $s32 = '^A'    $s23 = 'F2';     $s33 = '^B'    $i10 = 0    whilei $i0 < 4    {        $s0 = 'fkmap '+$s[20+$i10]+' '+$s[30+$i10]        exec $s0        $i10 = $i10 + 1    }.DE        .*s 2 "exit"usage: exit [<status>]This command causes an abrupt termination of the ECU program.Any existing connection with a remote systemis terminated immediately.If no integer argument <status> is found, ECU exitswith a program exit status of 0.If <status> is found and the value is zero, then ECU exitswith a program exit status of 0.If <status> non-zero,its value must be in the range of 1 to 31,and ECU exitswith a program exit status of 192 plus <status>.This feature allows batch executions of ECU by shell scriptto detect user-determined ECU execution status.See the section titled "Exit Codes"..*s 2 "expresp"usage: expresp [-v[v...]] <exp-resp-str> [<timeout_msecs>]This command emulates the uuchat function as described in theSCO HDB UUCP documentation and in the /usr/lib/uucp/Dialersfile.-v causes the expect-respond conversation between ECU and theremote system to be displayed on the screen.  This switch isautomatically enabled if procdedure tracing is enabled.Multiple v's (e.g., -vv, -vvv) up to 3 'v's producemore verbose debug output. -vv causes each base levelexpect and respond string to be displayed. -vvv causesa hexadecimal dump of each  interpreted expect string to be

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -