📄 _p_cmd.txt
字号:
.DE.DS L hexdump -ts 'Example hex dump' %left($s0,9)Example hex dump0000 54 68 65 20 71 75 69 63 6B | The quick |.DE.DS L hexdump -s %left($s0,9)0000 54 68 65 20 71 75 69 63 6B | The quick |.DE.*s 2 "home"usage: homeThis command homes the video cursor..*s 2 "icolor"usage: icolor <int-colors>This command sets the normal and reverse foregroundand background colors according to <int-colors>, an integervalue in the format as that returned by the.B %colorsinteger function.This command is provided primarily to be able to save the colorstate, modify it temporarily and then restore it..DS LExample: mkvar $icolor_save; $icolor_save = %colors color red; echo 'Connection seems to be dead' icolor $icolor_save # restore previous colors.DE.*s 2 "ifi".DS Lusage: ifi <int> <rel-op> <int> <statement> ifi <int> <rel-op> <int> <statement> ifi <int> <rel-op> <int> { any kind or number of statements }.DEThis command selectively executes one or more statementsbased on a test of two integer quantities. See thedescription of the.B break ,.B continue ,and.B elsecommmands for examples of how the command is used..*s 2 "ifs".DS Lusage: ifs <str> <rel-op> <str> <statement> ifs <int> <rel-op> <int> <statement> ifs <int> <rel-op> <int> { any kind or number of statements }.DEThis command selectively executes one or more statementsbased on a test of two string values. See thedescription of the.B break ,.B continue ,and.B elsecommmandsand many other examples throughout the document,for examples of how the command is used..*s 2 "insline"usage: inslineThis command inserts a line onto the video screen at the current line..*s 2 "lbreak"usage: lbreakThis command transmits a break to the remote system.It is the procedure command analogous to the.B breakinteractive command..*s 2 "lgets".DS Lusage: lgets [-er] <strvar> <t1-int> <t2-int> [<stop-str>]-e echo received characters to screen-r raw read (retain carriage returns).DEThis command reads a string from the attached communicationsline.<t1-int> is the number of tenths of seconds beforetiming out waiting for the first character to be received.<t2-int> is the number of tenths of seconds beforetiming out on later characters.<stop-str> is an optional argument, which if received, immediatelyterminates the read.Integer variable $i0 is set to the count of characters received.If the specified string variable is filled with charactersbefore the <stop-str> has been encountered or before a timeoutoccurs, then the command returns with $i0 set to the maximumsize of the variable. Most procedure commands will increase the size of an unumbered string variable as needed until the maximum string size is reached.The.B lgetscommand.I does.I not .You must start with the command with a string variable whose maximum sizeis already the desired value.Refer to the section on string variablesabove and the section describing the.B mkvarcommand below for information on the size of string variables..*s 2 "logevent".DS Lusage: logevent <str>.DEThis command writes a log item to ~/.ecu/log..DS LExample: $s0='/tmp/alm.log' log 'appending alarm info to '+$s0writes:10-02-1989-17:39-01261-PROC appending alarm info to /tmp/alm.log.DEassuming the transmitter process pid is 1261 and you are living in1989..*s 2 "lookfor".DS Llookfor [-e] [quiet | <str>] [<timeout-int>]-e echo to screen while "looking".DEThis command is used to read from the attached commuications lineuntil one of two user-specified conditions occurs.The 'quiet' option waits for the line to becomequiet for the number of tenths of seconds specified by <timeout-int>.The other option reads the line until <str> is read from the lineor until <timeout-int> tenths of seconds elapses. With this option,integer variable $i0 is set to 1 if <str> is found within thetimeout period or 0 if not..DS LExamples: lookfor -e quiet 20 wait for quiet line for 2 secs lookfor 'word:' 50 wait for 'word:' for up to 5 secs.DE.*s 2 "mkvar".DS Lusage: mkvar [$]i<name> mkvar [$]s<name>(<size>).DEThis command creates one or more named (temporary)integer or string variables.The variable type is determines by the first characterof the variable, which must be 'i' or 's'. The size of a stringvariable must be specified via the <size> argument. An optional '$'may be supplies for neatness, but may be omitted if desired..*s 3 "Variable Names"The names for created (named, temporary) variables consist ofa dollar sign ('$'), an 'i' for integer or 's' for string andup to fifteen characters from the set [A-Za-z0-9_].The first character after the 'i' or 's' in <name> must be non-numeric. '$sxyz' and '$s_3xyz' are legal, but '$s3xyz'is not (it would be interpreted as '$s3' followed by the illegalcommand sequence 'xyz').The <name> space for integer and string variables are separate.It is possible to have an integer variable named '$ixyz' and a stringvariable named '$sxyz'. .*s 3 "Variable Life and Scope"The life and scope of created variables is forthe duration of the executionof the creating procedure. Procedures calledby the creating procedure (by 'do') can referencetemporary variables declared by aprevious procedure. When created, integer variables are setto zero and string variables are set to zero length.These features differ from numbered variableswhich retain their scope and values at all times, even whenprocedure execution terminates and ECU returns to interactive mode.Variables may be created by the same name more than once.The latest mkvar execution specifies the variable referenced.Thus if proc1 declares '$ixx' and calls proc2 which also declares '$ixx',proc2's variable is distinct from proc1's and disappears when proc2terminates, thus making proc1's available to it again, containingthe same value as it had at the time proc2 was called..*s 3 "String Variable Size"The maximum value for <size> is 16384.Regardless of the size specified in the creation of a stringvariable, ECU will usually expand it's size as necessary up to themaximum. Check the documentation for the operation you areperforming; if there is no exception noted, ECU will expandthe string maximum size as necessary. For instance, theset command will grow a string as part of assignment. However,the.B lgetscommand will not..DS LExamples: mkvar i_count mkvar $i_count mkvar s_20(20),s_80(80),i_timeout,$i_colors.DE.*s 2 "nap"usage: nap <int> nap -m <int>This command suspends procedure execution for <int> tenths ofseconds if .B -mis not specified.If -m is used, execution is suspended for <int> milliseconds.Note: the actual period execution is suspended depends, as usual,on the scheduling load of the system. For small -m values, be awarethat the granularity of the nap duration is set by the system,20 milliseconds for XENIX 286 and 386, 10 milliseconds for UNIX.If you need to know the frequency of the system clock,something like.DS L $i0 = %stoi(%getenv("HZ")).DEwill obtain the value for you (provided HZ is in the process' environment)..DS LExamples: nap 30 nap $i0*$i2 nap -m 50.DE.*s 2 "nice"usage: nice <int>This command sets the nice value of the process. It behavesexactly like the nice(S) or nice(2) system call. The <int> argumentmust be in the range 0 through 39, inclusive. If the callfails, a warning is printed and the procedure continues toexecute. The current nice value may be obtained using the.B %niceinteger function. See also the description of the.B niceinteractive command. .*s 2 "parity".DS Lusage: parity [even | odd | none] parity <str>.DEThis command sets the parity for the attached communications line.If <str> is supplied, the first character must be 'e', 'o' or 'n'.Uppercase equivalents are also accepted..DS LExamples: parity even parity 'e' parity 'Even now as we speak'.DE.*s 2 "pclose"usage: pclose <filenum>This command should be issued when a command started by theinteractive.B popencommandf completes..*s 2 "plog".DS Lusage: plog plog <str> plog off.DEThis command controls logging to a file of the screen output duringprocedure execution. With no argument, the command displays the statusof logging. <str> specifies a log file pathname, while the 'off'argument turns logging off.If procedure execution terminates due to an error, procedure loggingis turned off. However, if procedure execution terminatesnormally while logging is active, erratic and unpredictable portionsof interactive mode screen output will continue to be logged tothe current log file.The interactive mode command.B plogmay also be used to control procedure logging..DS LExample: mkvar s_logname(128) $s_logname = %dir+'logname' plog $s_logname echo 'Test' plog off;cd 'somewhere_else';plog $s_logname echo 'Test'.DE.*s 2 "popd".DS Lusage: popd [ | <#> | all].DEThis command returns to a previous directory after a.B pushdcommand has been previously executed.If no argument is supplied, the directory at the immediately previouslevel is restored. If a numeric argument is supplied, the directoryat the specified level is restored; the level numbers may be obtained byissuing a.B pushdcommand with no arguments.If the 'all' argument is supplied, it is treated as a numeric argument of 0;that is the directory stack is cleared and the directory at level 0 isrestored.The directory stack is shared between interactive and procedurecommands. Neither beginning nor ending a procedure affects thedirectory stack level..DS LExamples: popd popd 3 popd all.DE.*s 2 "popen"usage: popen [-switches] <filenum> <command>This command executes a shell command defined by the string argument <command>and associates it with the user-chosen file number <filenum> (whichmust be an integer value between 0 and 4, inclusive).The argument switches govern whether the command isto receive input from ECU or output to ECU and must be chosenfrom this list:.VL 15 4.LI -rThe command will output to ECU..LI -wThe command will receive input from ECU..LEThe switches argument may be omitted; in such cases,the file is opened as though '-r' had been supplied. However,if procedure tracing is enabled (see the description of theinteractive and procedure command.B ptrace ),a warning message will be issued.The command sets $i0 = 0 if successful, else to the.B errnofrom the associated system call (refer to the .B %errstrstring function and/or /usr/include/sys/errno.h)..DS LExample: popen 0 -r 'ls -l *.log' popen 1 -w 'cat | sort > /tmp/sorted'.DE.*s 2 "prompt"usage: prompt <str>This command allows selection of an alternate prompt to the interactivemode HOME command trigger.Refer to the section titled "ECUPROMPT"for more information on the interactive mode prompt.Note: the interactive and procedure.B hangupcommands both cause the default prompt to be reestablished..DS LExample: prompt %rname+' >' use remote name in prompt.DE.*s 2 "ptrace".DS Lusage: ptrace [ <str> | off ].DEThis command controls procedure execution tracing. Traceoutput is written to the screen and varys in its nature depending uponthe command being traced. Specifically, any change to a string orinteger variable is noted. If tracing is enabled, the output will alsobe written to any active procedure log file (see the.B ploginteractive and procedure commands).The majority of procedure tracing features use the current tracestate as a binary condition. That is, either tracing is doneor not. However, the procedure command.B exprespemits varying levels of debugging output in a manner similar tothe uucico -x flag..*s 2 "pushd".DS Lusage: pushd [ | <dir>].DEThis command either 1) saves the current directory pathname ona stack and establishes a new current directory or2) displays the current stack and current directory.The stack size is 10.If no argument is supplied, the directory stack is displayed.The directory stack is shared between interactive and procedurecommands. Neither beginning nor ending a procedure affects thedirectory stack level..DS LExamples: pushd pushd '/tmp'.DE.*s 2 "putf"Not yet implemented..*s 2 "return"usage: return [<int>]This command serves two functions: to return from a gosub to orreturn from a procedure execution. If <int> is supplied, it must be in therange 0 to 255. Other values result in a return value of 255.If no gosub is active,.B returncauses the currently executing procedure to terminate,returning either to a calling procedure or to the interactive mode.If <int> is supplied and it's value is nonzero, then all procedure execution isterminated and the integer status is printedon the screen along with the name of the executing procedure.If a gosub is active,.B returnor.B return0 causes control to return to the statement immediately following the.B gosubwhich invoked the subroutine.If <int> is supplied and it's value is nonzero, then all procedure execution isterminated and the integer status is printedon the screen along with the name of the executing procedure.It is not possible to terminate a procedure with normal status fromwithin a subroutine..DS LExample:#---------------------# gosub.ep#--------------------- echo 'main'; gosub SUB; echo 'back to main' returnSUB echo 'sub' gosub SUB2 echo 'back to sub' returnSUB2 echo 'sub2' return.DE.*s 2 "rk"usage: rk [-a]This command invokes C-Kermit toreceivefiles. ECU searches the PATH list for 'kermit' or 'ckermit',expecting to find Columbia University C-Kermit version 5A(173)or later. The file ~/.kermrc must be set up to have any desiredinitialization parameters you desire (refer to C-Kermitdocumentation for more information).The remote protocol must have been started prior to theexecution of this command.WARNING: until further notice, avoid suspending Kermitwith ^\Z. ECU is totally unprepared to act as a job controlprocess group leader.If switch '-a'
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -