wht@n4hgf (Warren Tucker) (01/05/91)
Submitted-by: Warren Tucker <wht@n4hgf> Posting-number: Volume 16, Issue 23 Archive-name: ecuman3/part02 ---- Cut Here and feed the following to sh ---- #!/bin/sh # this is ecuman3.02 (part 2 of ecuman3) # do not concatenate these parts, unpack them in order with /bin/sh # file doc/ecu.man continued # if touch 2>&1 | fgrep 'amc' > /dev/null then TOUCH=touch else TOUCH=true fi if test ! -r _shar_seq_.tmp; then echo 'Please unpack part 1 first!' exit 1 fi (read Scheck if test "$Scheck" != 2; then echo Please unpack part "$Scheck" next! exit 1 else exit 0 fi ) < _shar_seq_.tmp || exit 1 echo 'x - continuing file doc/ecu.man' sed 's/^X//' << 'SHAR_EOF' >> 'doc/ecu.man' && X cycle to the next entry or abort the cycle. X X If no entries are marked for redial, the current, highlighted directory X entry is used for dialing. X X To unmark a single entry, press 'M' (uppercase M). To unmark all X entries, press 'U'. X X X 4.7.3 Automatic Login Procedure X X Upon dialing from the menu, if a procedure file can be found in the X current directory or the users home .ECU subdirectory whose name matches X the logical name, then the procedure is executed with the argument X '!MENU'. It is the responsibility of the automatically executed X procedure to establish connection with the remote system (by using the X procedure dial command). An example of an automatic login procedure can X be found in the distribution subdirectory 'models' named 'sysname.ep'. X A companion procedure is 'unixlogin.ep'. X X For example, X X | entry name | telephone number | tty | baud P | ... X | sysname | 555-1234 | Any | 2400 N | ... X X X X X X X X X X X X X X X X X X X X X X X X Public Domain by wht@n4hgf 12/26/90 X X X X X X X X ECU Technical Description 30 X X X X #----------------------------------------------------------- X # sysname.ep - procedure to call UNIX-like system 'sysname' X # X # CONFIDENTIAL - This function should be chmod 0600 because X # it contains a password which you probably don't want to be X # common knowledge. X # X # This procedure calls 'unixlogin.ep' to do the hard work. X #----------------------------------------------------------- X X mkvar $s_pwd(20) # local variable preserves password X $s_pwd = 'password' # security by disappearing when the X # procedure terminates X X # also, by keeping the password text off the following line, X # the password will not be displayed if you abort (interrupt) X # the procedure X X do 'unixlogin' %argv(0) 'username' $s_pwd 'ansi-or-whatever' X X X X 4.8 DO : perform procedure X X usage: do <procname> [<arg> ... ] X X X Perform ECU procedure. Ecu searches for <procname>.ep in the current X directory. If the file is not found, the program looks for the file in X the ~/.ECU directory. One or more arguments may be passed to the X procedure. Arguments aare made available in the called procedure by use X of the %argc integer function and %argv string function. X X Unlike arguments to the do procedure command, arguments to the do X interactive command are not quoted and may not contain embedded spaces X or tabs. X X X X 4.9 DUplex : set/display duplex X X usage: duplex [ Full | Half ] X X X This command specifies whether or not ECU is to locally echo characters X typed by you at the keyboard. The overwhelming majority of remote X systems provide the echo function, in which case full duplex must be X used. For the rare occasions when the remote system does not echo your X keyboard input, setting half duplex will allow you to see what you are X typing. X X X X X Public Domain by wht@n4hgf 12/26/90 X X X X X X X X ECU Technical Description 31 X X X X When communicating with another terminal in a "teletype conversation", X setting half duplex is generally required. In such cases, use of the X nl, nlin and nlout commands may also be required. X X The default setting for duplex is full. X X X X 4.10 EXit : drop carrier, exit program X X usage: exit X X X This command terminates ECU promptly. If your modem does not drop X carrier upon loss of Data Terminal Ready (DTR), the command will X terminate ECU, but may leave the communications line off hook. It is X strongly recommended that you configure your modem to hang up the phone X line when DTR drops. A shorthand version of this command exists: '.' is X equivalent to exit. X X X X 4.11 FI : send text file to line X X usage: fi [<filename>] X X X "file insert": This command causes file characters to be inserted into X the transmit data stream as though they had been entered at the X keyboard. No error correction is provided, although XON/XOFF flow X control is obeyed. X X If <filename> is not entered on the command line, a prompt for the X filename is made. Once the filename has been entered and file has been X opened, you are asked whether the file should be transmitted at full X speed, by "echo pacing" or by a single line at a time. You may also X append an 'f', 'e' or 's' argument to the command line. X X If your remote can tolerate it, full speed transmission is the fastest. X Some systems are not capable of receiving large amount of data X ("streaming data") without pauses. Even with "full" speed transmission, X some "pacing" (inter-character delay) is introduced to ease loading on X the remote system. Pressing the interrupt key (DEL) stops a full speed X transmission. X X By specifying echo pacing, it is possible to increase the likelihood of X proper receipt. Echo pacing reads the return data stream to attempt to X keep from overloading the remote. Pressing the interrupt key (DEL) X stops an echo paced transmission. X X As a last resort, if echo pacing is not working for you, (i.e., you are X X X X Public Domain by wht@n4hgf 12/26/90 X X X X X X X X ECU Technical Description 32 X X X X using the command in an environment where the remote does not echo your X characters), single line at a time transmission is available. With X "single" line transmission, you must press the space key to initiate X sending each line. Pressing the 'ESC' or 's' key stops the transfer. X X X 4.12 FKey : function key definition X X usage: fkey [<keyset_name>] X X X This command allows the mapping of function keys F1-F12, PgUp, PgDn, End X and Ins and the cursor up, down, left and right keys to emit a desired X sequence of characters when a function key is pressed. <keyset_name> X specifies which key set in ~/.ecu/keys is to be selected. Sample entry: X X hayes X F1:escape:+ + + X F2:autoans:A T S 0 = 1 cr X F3:dial:A T D T X bbs X F1:cancel:^K X F2:yes:y cr X X X If a keyset_name matches a logical dial directory name, it is loaded X when the number is dialed. X X The characters in the mapped string may be any printable character or X one of the following: X X map -> character map -> character X --- ----------- --- ------------ X nul 0 000 00 ^@ | dle 16 020 10 ^P X soh 1 001 01 ^A | dc1 17 021 11 ^Q X stx 2 002 02 ^B | dc2 18 022 12 ^R X etx 3 003 03 ^C | dc3 19 023 13 ^S X eot 4 004 04 ^D | dc4 20 024 14 ^T X enq 5 005 05 ^E | nak 21 025 15 ^U X ack 6 006 06 ^F | syn 22 026 16 ^V X bel 7 007 07 ^G | etb 23 027 17 ^W X bs 8 010 08 ^H | can 24 030 18 ^X X ht 9 011 09 ^I | em 25 031 19 ^Y X nl 10 012 0a ^J | sub 26 032 1a ^Z X vt 11 013 0b ^K | esc 27 033 1b ^[ X ff 12 014 0c ^L | fs 28 034 1c ^( X cr 13 015 0d ^M | gs 29 035 1d ^] X so 14 016 0e ^N | rs 30 036 1e ^^ X si 15 017 0f ^O | us 31 037 1f ^_ X X X X X X Public Domain by wht@n4hgf 12/26/90 X X X X X X X X ECU Technical Description 33 X X X X 4.13 HAngup : hang up modem X X usage: hangup X X X This causes DTR to be momentarily interrupted, terminating any X outstanding connection. Your DCE (modem) must be able to drop carrier X upon loss of DTR. X X X 4.14 HElp : invoke help X X usage: help [<cmd-name>] X X X Issuing this command with no argument displays a list of commands X followed by a request for a command for further information. X X X 4.15 LLp : set session log to /dev/lp X X usage: llp X X X This command is a shorthand version of 'log /dev/lp'. /dev/lp must not X be under the control of a print spooler. X X X 4.16 LOFf : turn off session logging X X usage: loff X X X This command is shorthand for 'log off'. If session logging is active, X it is turned off. X X X 4.17 LOG : session logging control X X usage: log [-s] [-r] [ | off | filename ] X -s "scratch" previous file contents; otherwise append X -r "raw" logging; otherwise non-printable characters X other than tab and newline are omitted from the log X X X This command controls session logging; issuing the command with no X argument causes the status of session logging to be displayed. The X special argument 'off' causes active logging to be terminated. Other X argument values cause logging to start using the argument as a filename. X Issuing a log command with a filename when logging is already active X causes the previous file to be closed and the new file to be opened. X X X X Public Domain by wht@n4hgf 12/26/90 X X X X X X X X ECU Technical Description 34 X X X X Switches are meaningful only when used in conjunction with a filename to X start logging. X X X X 4.18 NL : display CR/LF mapping X X usage: nl X X X Display the current setting of CR/LF mapping. For more information, X refer to the nlin and nlout command descriptions. X X X X 4.19 NLIn : set receive CR/LF mapping X X usage: nlin [<y-n>] X X X This command controls whether or not a newline (NL/LF) character is sent X to the screen upon receipt of a carriage return (CR) from the remote X system. Most remote computers supply a NL after CR. When communicating X with another terminal in a "teletype conversation", this is generally X not the case (see also the duplex command). X X Issuing the command without <y-n> causes the current setting to be X displayed. The format of <y-n> is flexible: 'y' or '1' enables X appending NL to CR, 'n' or '0' causes the feature to be disabled. X X X X 4.20 NLOut : set transmit CR/LF mapping X X usage: nlout [<y-n>] X X X This command controls whether or not a newline (NL/LF) character is sent X to the remote system upon transmission of a carriage return (CR) entered X by the keyboard. Most remote computers do not require (indeed X "dislike") a NL after CR. When communicating with another terminal in a X "teletype conversation", this is generally not the case (see also the X duplex command). X X Issuing the command without <y-n> causes the current setting to be X displayed. The format of <y-n> is flexible: 'y' or '1' enables X appending NL to CR, 'n' or '0' causes the feature to be disabled. X X X X X X X X Public Domain by wht@n4hgf 12/26/90 X X X X X X X X ECU Technical Description 35 X X X X 4.21 OA : octal to ascii char X X usage: oa [<octal-val>] X X X <octal-val> is a octal value between 0 and 0377; the parity (sign) bit X is stripped and the equivalent ASCII character value is displayed. X X If no argument is supplied, a table of control characters is printed X containing decimal, octal, hex, ASCII identifiers and two-character X control character identifier. X X X X 4.22 PARity : set/display line parity X X usage: parity [ None | Even | Odd ] X X X This command controls the parity of characters transmitted by the X keyboard. Issuing the command with no argument displays the current X setting. When the argument is supplied, only the first character is X required. Even or odd parity implies seven data bits; no parity implies X eight data bits. Parity of incoming characters is not checked. X X The setting may be automatically changed as the result of an interactive X or procedure dial command. See the baud and dial command descriptions. X X X X 4.23 PId : display process ids X X usage: pid X X X This command displays the process id of the ECU transmitter process, the X ECU receiver process and the process ids of ECU's parent and group. X X X 4.24 PLog : procedure logging X X usage: plog [ <filename> | off] X X X This command enables or disbles procedure logging. X X X X X X X X X X Public Domain by wht@n4hgf 12/26/90 X X X X X X X X ECU Technical Description 36 X X X X 4.25 PTrace : control procedure trace X X usage: ptrace [ 0 | 1 | on | off] X X X This command controls whether or not procedure execution is to be X traced. Trace output is written to the screen and varys in its nature X depending upon the command being traced. Specifically, any change to a X string or integer variable is noted. If tracing is enabled, the output X will also be written to the procedure log file (see the interactive and X procedure commands). Issuing the command with no argument shows current X status. X X X 4.26 PWd : print working directory X X usage: pwd X X X This command prints the current working directory of the ECU process. X X X X 4.27 REDial : redial last number X X usage: redial [<retry-count> [<pause-interval>]] X X X This command redials a number previously dialed with the 'dial' command. X Modem status is tested and multiple retries may be made. <retry-count> X specifies how many retries are to be made. <pause-interval> specifies X how many seconds the program pauses after a failure to connect. You X must specify <retry-count> in order to specify <pause-interval>. The X default value for <retry-count> is 10, for <pause-interval> is 60. X X You should know that in some jurisdictions, it is ILLEGAL to dial the X same telephone number more than a specified number of times during some X interval of time. In any case, a <pause-interval> less than 15 seconds X is silently changed to 15 seconds. X X X 4.28 REV : ECU revision/make date X X usage: rev X X X This command displays ECU's revision, the transmitter process id' and X the date and time ECU was made. X X X X X X X Public Domain by wht@n4hgf 12/26/90 X X X X X X X X ECU Technical Description 37 X X X X 4.29 RK : receive via C-Kermit X X usage: rk X X X This command searches the PATH list for 'ckermit' (Columbia University X C-Kermit) and invokes it to receive files. X X The file ~/.kermrc must be set up to have any desired initialization X paraeters you desire. Refer to C-Kermit documentation for more X information. X X X X 4.30 RS : receive via SEAlink X X usage: rs X X X This command invokes a SEAlink receive protocol. X X X 4.31 RTScts : control RTS/CTS flow control X X usage: rtscts [ off| on | no | yes | 0 | 1 | 2 | 3 ] X X X This command controls the RTS/CTS flow control feature of the SCO X UNIX/XENIX line driver (which may or may not work). If no argument is X supplied, the current setting is displayed. Specifying 0 or n disables X the facility; 1 or y causes RTS/CTS flow control to be enabled. X X What the command does is to manipulate the RTSFLOW and CTSFLOW bits of X the termio c_cflag word (see termio(S)). X X X argument | RTSFLOW | CTSFLOW X ---------+---------+--------- X off | 0 | 0 X on | 1 | 1 X no | 0 | 0 X yes | 1 | 1 X 0 | 0 | 0 X 1 | 1 | 1 X 2 | 1 | 0 X 3 | 0 | 1 X X X X X X X X X Public Domain by wht@n4hgf 12/26/90 X X X X X X X X ECU Technical Description 38 X X X X 4.32 RX : receive via XMODEM/CRC X X usage: rx X X X This command invokes ecurz to receive files from the remote system using X XMODEM/CRC. X X After entering the command, you are prompted as to whether or not file X CR/LF characters are to be converted to newlines. If you are X transferring text files from a system which contain CR/LF line X terminators, you must answer yes to this question. You should answer no X when transferring binary files, such as executables, .arc files and the X like. File transfer progress is presented on a visual display. To X abort the transfer, press your interrupt key (usually DEL unless reset X with stty(C)). X X X X 4.33 RY : receive via YMODEM Batch X X usage: ry X X X This command invokes ecurz to receive files from the remote system using X YMODEM batch with CRC-16 error correction. The YMODEM is "true YMODEM", X not XMODEM-1k. File transfer progress is presented on a visual display. X To abort the transfer, press your interrupt key (usually DEL unless X reset with stty(C)). X X X X 4.34 RZ : receive via ZMODEM/CRC32 X X usage: rz X X X This command invokes ecurz to receive files from the remote system using X ZMODEM/CRC32. File transfer progress is presented on a visual display. X To abort the transfer, press your interrupt key (usually DEL unless X reset with stty(C)). X X X X 4.35 SDNAME : select screen dump file name X X usage: sdname [<filename>] X X X When the "cursor 5" key is pressed, the screen contents are dumped to a X file. By default, this file is named '~/.ecu/screen.dump'. This X X X X Public Domain by wht@n4hgf 12/26/90 X X X X X X X X ECU Technical Description 39 X X X X command either displays or changes the current screen dump file name, X depending upon whether or not a argument is supplied. X X The actions of this command have no effect on the operation of the X procedure command. X X See the section titled "Screen Dump" for more information. X X X 4.36 SK : send via C-Kermit X X usage: sk [<file-list>] X X X This command searches the PATH list for 'ckermit' (Columbia University X C-Kermit) and invokes it to send files. The file ~/.kermrc must be set X up to have any desired initialization paraeters you desire. X X After entering the command, you are prompted as to whether or not file X newline characters are to be converted to CR/LF. If you are X transferring text files to a system which requires CR/LF line X terminators, you must answer yes to this question. You should answer no X when transferring binary files, such as executables, .arc files and the X like. You are prompted to enter a list of files to send, which may X contain one or more wildcard specifications. X X The file ~/.kermrc must be set up to have any desired initialization X arguments you desire. Refer to C-Kermit documentation for more X information. X X X X 4.37 SS : send via SEAlink X X usage: ss [<file-list>] X X X This command invokes a SEAlink file transmission protocol. X X X .--[ Send SEAlink ]-------- dir: /u1/src/ecu ------------------. X | | X | File(s) to send: | X | ___________________________________________________________ | X | | X | TAB:next ^B:prev END:perform transfer ESC:abort | X `-- enter file(s) to send -------------------------------------' X X X X X X X X Public Domain by wht@n4hgf 12/26/90 X X X X X X X X ECU Technical Description 40 X X X X 4.38 STat : connection status X X usage: stat X X X This command displays statistics about ECU usage. Example display: X X Date/time: 06-14-1988 11:40:35 (UTC 15:40) X Total chars transmitted: 178 X Total chars received: 3681 X X Date/time: 06-14-1988 14:41:24 (UTC 18:41) X Connected to CompuHost (555-1234) at 14:40:57 X Parameters: 2400-N-1 Connect time: 00:01:27 X Total chars transmitted: 234 (since CONNECT 142) X Total chars received: 2278 (since CONNECT 1478) X X X X 4.39 SX : send via XMODEM/CRC X X usage: sx [<file-name>] X X X This command invokes ecusz to send a file to the remote system using X XMODEM/CRC. X X After entering the command, you are prompted as to whether or not file X CR/LF characters are to be converted to newlines. If you are X transferring text files from a system which contain CR/LF line X terminators, you must answer yes to this question. You should answer no X when transferring binary files, such as executables, .arc files and the X like. X X You are prompted to enter a filename to send. File transfer progress is X presented on a visual display. To abort the transfer, press your X interrupt key (usually DEL unless reset with stty(C)). X X .--[ Send XMODEM/CRC ]----- dir: /u1/src/ecu -----------. X | | X | File to send: | X | ____________________________________________________ | X | | X | Binary: Y (no NL-CR/LF translation) | X | | X | TAB:next ^B:prev END:perform transfer ESC:abort | X `-- enter file(s) to send ------------------------------' X X X X X X X X Public Domain by wht@n4hgf 12/26/90 X X X X X X X X ECU Technical Description 41 X X X X 4.40 SY : send via YMODEM Batch X X usage: sy [<file-list>] X X X This command invokes ecusz to send file(s) to the remote system using X YMODEM/CRC. X X You are prompted to enter filename(s) to send, which may consist of one X or more wildcard specifications. File transfer progress is presented on X a visual display. To abort the transfer, press your interrupt key X (usually DEL unless reset with stty(C)). X X .--[ Send YMODEM/CRC ]----- dir: /u1/src/ecu -----------. X | | X | File to send: | X | ____________________________________________________ | X | | X | Binary: Y (no NL-CR/LF translation) | X | | X | TAB:next ^B:prev END:perform transfer ESC:abort | X `-- enter file(s) to send ------------------------------' X X X X 4.41 SZ : send via ZMODEM/CRC32 X X usage: sz [<file-list>] X X X This command invokes ecusz to send file(s) to the remote system using X ZMODEM/CRC32. X X You are prompted to enter filename(s) to send, which may consist of one X or more wildcard specifications. File transfer progress is presented on X a visual display. To abort the transfer, press your interrupt key X (usually DEL unless reset with stty(C)). X X Note: if you specify sending only newer files and the remote receiver X does not support the feature, it may skip (reject) all your files. X Retry the transfer specifying 'N' to 'Transfer only newer files'. X X X X X X X X X X X X X X Public Domain by wht@n4hgf 12/26/90 X X X X X X X X ECU Technical Description 42 X X X X | | X | File(s) to send: | X | ckermit-5a-130 | X | | X | Binary: Y (no NL-CR/LF translation) | X | Overwrite destination files: Y | X | Send full pathames: N | X | Transfer only newer files: N | X | | X | TAB:next ^B:prev END:perform transfer ESC:abort | X `-- enter file(s) to send ---------------------------------------' X `-- Y: no conversion, N: NLs converted to CR/LF -----------------' X `-- Y: overwrite, N: protect destination files ------------------' X `-- Y: full pathnames, N: strip directory portion from names ----' X `-- Y: send only if source newer than destination, N send all ---' X X X X 4.42 TIme : time of day X X usage: time X X X This command displays the local date and time as well as the current X UTC. X X X 4.43 TTy : console tty name X X usage: tty X X X This command displays the current console tty name. X X X X 4.44 XA : hex to ascii char X X usage: xa [<hex-val>] X X X <hex-val> is a hexadecimal value between 0 and FF; the parity (sign) bit X is stripped and the equivalent ASCII character value is displayed. X X If no argument is supplied, a table of control characters is printed X containing decimal, octal, hex, ASCII identifiers and two-character X control character identifier. X X X X X X X X Public Domain by wht@n4hgf 12/26/90 X X X X X X X X ECU Technical Description 43 X X X X 4.45 XON : xon/xoff flow control X X usage: xon [<arg>] X where <arg> is on input and output flow control X off no flow control X in input flow control X out output flow control X X X This command enables or disables xon/xoff flow control. If the argument X is omitted, the current flow control state is displayed. X X X 4.46 ! : execute shell X X usage: ! X !<command> X X X The '!' command is a shell escape. The environment variable SHELL is X read to determine what shell program to execute (e.g., /bin/sh, etc). X If '!' is entered by itself, an interactive shell is started; press ^D X to exit back to ECU. If <command> is supplied, it is executed by the X shell with an immediate return to ECU. X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X Public Domain by wht@n4hgf 12/26/90 X X X X X X X X ECU Technical Description 44 X X X X 5. Procedure Language X X X Sample procedures are shown in the companion document 'samplproc.man'. X X X X 5.1 Arguments X X X There are five types of arguments to procedure commands: X X Switch X Alphabetic Token X Integer X String X Relational Operators X X This section describes the syntax and construction of each type in turn. X There are separate groups of valid of relational operators for integers X and strings; thus, they are described under the appropriate sections. X X X 5.1.1 Switches X X Switch arguments begin with a hyphen (minus, '-'). The switch argument X must be the first argument after the command. Only one switch argument X is allowed on the command line. If switches '-a', '-b' and '-c', are X available and '-a' and '-b' are desired, '-ab' or '-ba' is entered. X X X 5.1.2 Alphabetic Tokens X X Alphabetic tokens, for lack of a better term, are non-integer, non- X quoted terms used as arguments for certain commands, such as: X X plog off X X Such argument types are fairly simple to understand and use; they are X described here for completeness. X X X 5.1.3 Integers X X Integer values are 32-bit quantities ranging between -2147483647 and X 2147483647. X X In one case, an integer is used to store a 32-bit color mask as X described by the color command and the %colors integer function. X X X X X X Public Domain by wht@n4hgf 12/26/90 X X X X X X X X ECU Technical Description 45 X X X X 5.1.3.1 Constants X X Integer constants are numeric strings, optionally with an initial minus X sign, the absolue value of which must be less than 2147483648. X X X 5.1.3.2 Variables X X There are 50 numbered, permanent integer variables referenced by the X terms '$i0' through '$i49'. When ECU is started, the value of each X variable is zero. Variables retain their value until changed, even X between procedure executions. The integer variable number may be X expressed as an expression by enclosing an integer expression in X brackets. For instance: X X $i[4+5] refers to $i9 X X $i2=5 X $i[20+$i2] refers to $i25 X X X Integer variables may be created for use as "local" variables or to X promote code readability. Refer to the mkvar command. X X X 5.1.3.3 Functions X X ECU has many built-in functions which return the value of ecu- or X system-related information. A list of the functions appears in a later X section. X X X 5.1.3.4 Expressions X X In almost any place an integer argument is allowed, an expression may be X supplied. Expressions are composed of two or more integer constants or X variables separated by operators from the group: X X + addition X - subtraction X * multiplication X / division X | OR X @ MOD X ^ XOR X & AND X X Evaluation of expressions is left-to-right. Parentheses are not X allowed. X X X X X X Public Domain by wht@n4hgf 12/26/90 X X X X X X X X ECU Technical Description 46 X X X X 5.1.3.5 Relational Operators X X Integer relational operators are chosen from the following group: X X = "is equal to" X == "is equal to" X != "is not equal to" X <> "is not equal to" X > "is greater than" X < "is greater than" X >= "is greater than or equal to" X <= "is less than or equal to" X X X X 5.1.4 Strings X X Strings are classic concatenations of zero or more eight-bit characters. X In general, the maximum size of a string used by ECU is 256 characters. X The absolute maximum size is 5120 characters. X X X 5.1.4.1 Constants X X String constants are formed by placing alphanumeric characters between X single quote characters (apostrophes). The backslash ('\') character is X used to "escape" certains characters: X X '\' one backslash X '0 newline X '' tab X ''' apostrophe X X X X 5.1.4.2 Variables X X There are 50 numbered, permanent string variables referenced by the X terms '$s0' through '$s49', each possessing a maximum length of 256 X characters When ECU is started, the value of each variable is null (zero X length). Variables retain their value until changed, even between X procedure executions. The string variable number may be expressed as an X expression by enclosing an string expression in brackets. For instance: X X $s[4+5] refers to $s9 X X $s2=5 X $s[20+$s2] refers to $s25 X X X String variables may be created for use as "local" variables or to X X X X Public Domain by wht@n4hgf 12/26/90 X X X X X X X X ECU Technical Description 47 X X X X promote code readability. Refer to the mkvar command. Created variables X have a life equal to the duration of the procedure which created them. X Regardless of the declared size of a created string variable, ECU will X automatically grow it to a maximum of 5120 characters as necessary. X Numbered (permanent) string variables have a maximum size of 256 bytes. X X X 5.1.4.3 Functions X X ECU has many built-in functions which return the value of ecu- or X system-related information. A list of the functions appears in a later X section. X X X 5.1.4.4 Expressions X X String expressions are formed by the concatenation of string constants, X variables and function return values using the '+' operator: X X Example: X 'The quick brown fox jumped over the '+$s0'+' dog at '+%time X X X X 5.1.4.5 Relational Operators X X String relational operators are chosen from the following group: X X = "is equal to" X == "is equal to" X != "is not equal to" X <> "is not equal to" X X X X X 5.2 Commands X X X X 5.2.1 baud X X usage: baud <baud-int> X X This command sets the baud rate for the attached line. The integer X argument <baud-int> must be one of 110, 300, 600, 1200, 2400, 4800, X 9600, 19200 and 38400. X X X X X X X X Public Domain by wht@n4hgf 12/26/90 X X X X X X X X ECU Technical Description 48 X X X X Example: X baud 9600 X set $i0=2400; baud $i0 X X X X 5.2.2 break X X usage: break X X This command is used inside a whilei or whiles compound statement to X exit the loop. X X Example: X X whilei 1=1 #forever unless break command executed X { X echo -n 'Answer yes or no: ' X set $s0=%cgets # get answer X ifi %instr($s0,'y') == 0 set $i0 = 1; break X ifi %instr($s0,'n') == 0 set $i0 = 0; break X # got neither 'y' nor 'n' ... keep trying X } X # now $i0 = 1 if yes, 0 if no X X X NOTE: further examples of break usage may be found in the example for X the else command. X X X 5.2.3 cd X X usage: cd <directory-path> X X This command changes ECU's current working directory. The string X argument <directory-path> may contain any directory pathname X specification legal to be submitted to the shell csh. Wild card X characters may be used, provided the expansion produces only one X pathname. X X X Example: X X cd '~user/bin' X cd %envvar('HOME')+'/bin' X X X X 5.2.4 clrx X X usage: clrx X X X X Public Domain by wht@n4hgf 12/26/90 X X X X X X X X ECU Technical Description 49 X X X X This command clears the attached line's transmitter XOFF state. X Issuing the command is the equivalent to receiving an XON from the X remote system. X X X 5.2.5 cls X X usage: cls X X This command clears the screen. X X X 5.2.6 color X X X usage: color <normal-foreground> [<normal-background>] X usage: color -r <reverse-foreground> [<reverse-background>] X X X This command changes the current normal or reverse video colors in a X manner similar to the setcolor(C) command. It has no effect on systems X using a monochrome monitor. If the second (background) color is X omitted, it is assumed to be black. X X The command also forces normal video mode. Refer to the vidnorm and X vidrev commands. Refer also to the vidcolor command. X X X Color names X blue magenta brown black X lt_blue lt_magenta yellow gray X cyan white green red X lt_cyan hi_white lt_green lt_red X X Example: X X color lt_green # normal video light green on black X color -r red white # reverse video red on white X X X X 5.2.7 continue X X usage: continue X X This command is used inside a whilei or whiles compound statement to X skip the remainder of any commands in the loop and continue execution at X the first command in the loop. X X X X X X X Public Domain by wht@n4hgf 12/26/90 X X X X X X X X ECU Technical Description 50 X X X X Example: X X send '' # send ENTER to get prompt X whilei 1=1 # forever unless break command executed X { X lookfor -e 'login: ' # look for login prompt X ifi $i0 == 0 # if we dont get prompt ... X { X send '' # send ENTER again X continue # and look for login prompt X } X send $s_name # send username X lookfor -e 'Password:' X send $s_password X get -e 0 50 # wait 10 seconds for response X X # if incorrect not found in response, ... X if %instr($s0,'incorrect') < 0 # ... must have won X break X X # garbled line?: system will send another 'login: ' X } X X X X NOTE: further examples of continue usage may be found in the example for X the else command. X X X 5.2.8 cursor X X usage: cursor <row> [<col>] X X This command places the cursor at a specified position on the video X screen. The top left of the scrren is row 0, column 0. If <col> is not X specified, it is assumed 0 (left margin). X X Example: X X cls X $i0 = 5 X whilei $i5 < 12 X { X cursor $i5 X echo 'This is line '+%itos($i5,2d)+' of the display' X } X X X X X X X X X Public Domain by wht@n4hgf 12/26/90 X X X X X X X X ECU Technical Description 51 X X X X 5.2.9 delline X X usage: delline X X This command deletes the current line from the video display. X X X 5.2.10 dial X X usage: dial <remote> X X This command causes an outgoing call to be placed. The string argument X <remote> can take one of two forms: a numeric telephone number or an X alphanumeric "logical" number or system name. X X A numeric phone number ('1(800)555-1212' or '2345678') must begin with a X digit and must consist entirely of digits, parentheses or hyphens. If a X telephone number is supplied, the phone number is dialed; you must first X have set the desired baud rate and parity using the 'baud' and 'parity' X commands. X X If a logical name is entered, the phone directory (managed by the X interactive dial command) is searched; if the entry is found, the baud X rate and parity is automatically set from values in the directory entry; X then, the number in the directory entry is dialed. X X See the section on the interactive "Dial" command and the section titled X "Choosing a Dialout Line" for more information. X X When the dial command returns, integer variable $i0 is set to a status X code and string variable $s0 has a text message (the modem verbal result X code if the ECU dialer is used, a representation of the return status X code if a uucp dialer is used [see below]). X X Dial Command $i0 Status Codes X X 0 successful connect X 1 failed to connect (call progress) X 2 dial interrupted by signal X 3 modem error (non responsive or commands rejected) X X X X X X X X X X X X X X X Public Domain by wht@n4hgf 12/26/90 X X X X X X X X ECU Technical Description 52 X X X X Dial Command $s0 Status Messages (uucp dialer) X X CONNECT #### #### = baud rate X BUSY only some modems X NO ANSWER only some modems X NO CARRIER most generic "fail to connect" X NO DIAL TONE only some modems X !Connect bad baud rate modem reported different rate X !Interrupted call interrupted by signal X !Invalid arguments ECU error X !Invalid phone number too long or bad characters X !Ioctl error should not be reported here X !Line in use should not be reported here X !Line open error should not be reported here X !Modem Error modem did not respond X X Note: if the ECU dialer is used, the actual modem result code X is returned in $s0 or one of the following two strings: X X !Interrupted call interrupted by signal X !Modem Error modem did not respond X X X X 5.2.11 do X X usage: do <procname> [<arg> ...] X X This command executes a procedure whose name appears as the command's X first (string) argument. One or more arguments (up to 19) may be passed X to the called procedure; an argument may consist of any valid string X expression, provided, that, when expanded, the argument does not exceed X 256 characters in length. X X The called procedure may read its arguments using the %argv string X function. %argv(0) is the name of the procedure. The quantity of X arguments may be obtained using the %argc integer function. X X X Example: X X do 'proc' %rname %date+' '+%time %argv(0) X X Note: in this example, the called procedure is passed the name X of the calling procedure as the last argument. X X X X 5.2.12 duplex X X X X X X Public Domain by wht@n4hgf 12/26/90 X X X X X X X X ECU Technical Description 53 X X X X usage: duplex full | half X duplex 'full' | 'half' X X X This command specifies whether or not ECU is to locally echo characters X typed by you at the keyboard. The overwhelming majority of remote X systems provide the echo function, in which case full duplex must be X used. For the rare occasions when the remote system does not echo your X keyboard input, setting half duplex will allow you to see what you are X typing. X X When communicating with another terminal in a "teletype conversation", X setting half duplex is generally required. In such cases, use of the X interactive nl, nlin and nlout commands may also be required. X X Example: X X duplex full X $s0 = 'full'; duplex $s0 X X X X X 5.2.13 echo X X usage: echo [-n] <string> X X This command prints the contents of the string argument <string> on the X screen. If the -n switch is not present, a newline follows the output X of <string>. X X Example: X X echo 'Procedure '+%argv(0)+' executing at '+%time X echo -n 'Enter your first name: '; $s0 = %cgets X X X X 5.2.14 eeol X X usage: eeol X X This command erases the video display to the end of the line. X X X 5.2.15 else X X X This statement may follow an ifi or ifs command to specify one or more X statements to be executed if the if-type command condition is false. X Else commands may be chained together in the traditional structured X X X X Public Domain by wht@n4hgf 12/26/90 X X X X X X X X ECU Technical Description 54 X X X X usage: else <statement> X X else X <statement> X X else X { X any kind and number of statements X } X X else <if> <statement> X X else <if> X { X any kind and number of statements X } X X X language manner. X X For the purposes of describing this command, <statement> is any single X or compound statement NOT containing a whilei or whiles command. If you X wish to have a while-type command executed as part of an else condition, X the while must occur within braces ("{}"). X X <if> is an ifi or ifs command followed by an <if-condition> (see the X description of the ifi or ifs commands below). X X X X X X X X X X X X X X X X X X X X X X X X X X X X Public Domain by wht@n4hgf 12/26/90 X X X X X X X X ECU Technical Description 55 X X X X Example: X X #+------------------------------------------------------ X # finger.ep - procedure to send 'finger' to remote X # BSD Unix system; print resulting lines in different X # colors: uucp logins green, root red, others cyan X #------------------------------------------------------- X X mkvar $icolor; $icolor = %colors X mkvar $itimeout X $itimeout = 50 # timeout for first line 5 secs X send 'ps -aux' # send command, but do not echo X lookfor '0 40 # swallow command X whilei 1==1 # forever, or until break X { X lgets 0 $itimeout 1 '0 #get a line X ifi $i0 = 0 break #if no chaacters read X $itimeout = 10 #wait 1 sec for later lines X X ifi %instr($s0,'% ') >= 0 # if csh prompt seen X break # exit while loop X else ifi %instr($s0,'Login') >= 0 X color gray X else ifi %instr($s0,'root') >= 0 X color red X else ifi %instr($s0,'uucp') >= 0 X color green X else color cyan X echo $s0 X } X icolor $icolor #restore entry colors X send '' #force a new prompt from remote X X X X X 5.2.16 exit X X usage: exit [<status>] X X This command causes an abrupt termination of the ECU program. Any X existing connection with a remote system is terminated immediately. If X no integer argument <status> is found, ECU exits with a program exit X status of 0. If <status> is found and the value is zero, then ECU exits X with a program exit status of 0. If <status> non-zero,its value must be X in the range of 1 to 31, and ECU exits with a program exit status of 192 X plus <status>. This feature allows batch executions of ECU by shell X script detect user-determined ECU execution status. See the section X titled "Exit Codes". X X X X X X Public Domain by wht@n4hgf 12/26/90 X X X X X X X X ECU Technical Description 56 X X X X 5.2.17 expresp X X usage: expresp [-v[v...]] <exp-resp-str> [<timeout_msecs>] X X This command emulates the uuchat function as described in the SCO HDB X UUCP documentation and in the /usr/lib/uucp/Dialers file. X X -v causes the expect-respond conversation between ECU and the remote X system to be displayed on the screen. This switch is automatically X enabled if procdedure tracing is enabled. X X multiple v's (e.g., -vv, -vvv) up to 3 'v's produce more verbose debug X output. -vv causes each base level expect and respond string to be X displayed. -vvv causes a hexadecimal dump of each interpreted expect X string to be displayed. X X <exp-resp-str> is as defined in /usr/lib/ecu/Dialers. X X Meaning of some of the escape characters: X - pause (approximately 1/4-1/2 second delay) X X - delay (2 seconds) X D - phone number/token X T - phone number with Dialcodes and character translation X N - null byte X K - insert a BREAK X E - turn on echo checking (for slow devices) X \--carriagefreturnchecking X - send new-line X n - send octal number X m## - delay ## milliseconds (NOT SUPPORTED BY DIALERS; X SEE BELOW) X ~t[##] - set timeout to ## seconds (see below) X ~m[##] - set timeout to ## milliseconds (see below) X Speed - Hayes-specific speed-adaptive connect handler X X X <timeout_msecs> specifies an optional timeout in milliseconds for X waiting on expect strings; it defaults to 10,000 milliseconds (10 X seconds). The resolution for timeouts is limited to the basic tick time X of your system (HZ, 10 msec for UNIX/386, 20 msec for XENIX/386 and X XENIX/286). The timeout for 'Speed' expects is fixed at 90 seconds. X X \m### causes a ### millisecond delay. Note this adds an ambiguity to X the syntax of the send string: you may not follow an m delay with a X literal digit to send. For example, suppose you wish to delay 300 X missileconds then send "4A". \m3004A will delay for 3004 X (approximately) milliseconds, then send an "A". X X Integer variable $i0 is set to one if the expect-respond script fails, X else it is set to 0. X X X X Public Domain by wht@n4hgf 12/26/90 X X X X X X X X ECU Technical Description 57 X X X X 5.2.18 fchmod X X usage: fchmod <mode> <file> X X This command sets the mode of <file> to <mode>. The <mode> argument X takes one of two forms, a nine-character mode string (e.g., 'rwxr-xr-x') X or an integer value (0755). The <file> argument is either a string X value forming a filename or an integer file number representing a file X opened with the fopen command. X X The command sets $i0 = 0 if successful, else to the errno from the X associated system call (refer to the %errstr string function and/or X /usr/include/sys/errno.h). X X X Example: X X fopen 1 '/tmp/123'; fchmod 'rwxrwxrwx' 1 X fchmod 'rwxrwxrwx' '/tmp/123' X fopen 1 '/tmp/123'; fchmod 0777 1 X $i0 = 0777; fchmod $i0 '/tmp/123' X X All of the above example result in the same result. X X X X 5.2.19 fclose X X usage: fclose <file> X X This command closes <file>. The <file> argument is an integer file X number representing a file opened with the fopen command. X X The command is ignored if <file> is not open. No integer variable is X modified by fclose. X X X Example: X X fclose 1 X X X X 5.2.20 fdel X X usage: fdel <file> X X This command removes a file. X X The command sets $i0 = 0 if successful, else to the errno from the X associated system call (refer to the %errstr string function and/or X X X X Public Domain by wht@n4hgf 12/26/90 X X X X X X X X ECU Technical Description 58 X X X X /usr/include/sys/errno.h). X X X Example: X X fdel '/tmp/123' X X X X 5.2.21 fgetc X X usage: fgetc <file> <destination> X X This command reads a character from <file>. The <file> argument is an X integer file number representing a file opened with the fopen command. X X The argument <destination> is either a string variable or an integer X variable. If the file has reached end of file: an integer variable X receives -1; a string variable is returned null. Otherwise, the X character's numeric value (0-255) is placed in an integer variable or a X string variable is returned with a length of one with the file character X as its only character. X X X Example: X X fgetc 1 $s0 X fgetc 1 $i_input X X X X 5.2.22 fgets X X usage: fgets <file> <strvar> X X This command reads a character from <file>. The <file> argument is an X integer file number representing a file opened with the fopen command. X X The argument <strvar> is a string variable. If the file has reached end X of file, <strvar> is returned null and integer variable $i0 is set to 1. X Otherwise, the <strvar> receives input from the file minus the trailing X newline and $i0 is returned zero. X X X Example: X X fgets 1 $s0 X X X X X X X X Public Domain by wht@n4hgf 12/26/90 X X X X X X X X ECU Technical Description 59 X X X X 5.2.23 fkey X X usage: fkey <str> X X This command selects a function key definition from the ~/.ecu/keys X file. X X X 5.2.24 flush X X usage: flush X X This command causes any characters received by the system from the line, X but not yet read by the procedure to be "forgotten" or flushed. X X X 5.2.25 fopen X usage: fopen [-switches] <filenum> <filename> X X This command opens a file named by the string argument <filename> and X associates it with the user-chosen file number <filenum> (which must be X an integer value between 0 and 4, inclusive). X X The argument switches govern how a file is opened and must be chosen X from this list: X X -r The file is opened read-only; if it does not exist, an X error occurs. X X -r+ The file is opened for reading and writing; if it does X not exist, an error occurs. X X -w The file is opened for writing (any previous contents of X the file are lost); if it does not exist, it is created. X X -w+ The file is opened for reading and writing (any previous X contents of the file are lost); if it does not exist, it X is created. X X -a The file is opened for appending (writes to the file are X added to the previous file contents); if it does not X exist, it is created. All writes are appended to the X file (the fseek command has no effect). X X The switches parameter may be omitted; in such cases, the file is opened X as though '-r' had been supplied. However, if procedure tracing is X enabled (see the description of the interactive and procedure command X ptrace), a warning message will be issued. X X The command sets $i0 = 0 if successful, else to the errno from the X associated system call (refer to the %errstr string function and/or X X X X Public Domain by wht@n4hgf 12/26/90 X X X X X X X X ECU Technical Description 60 X X X X /usr/include/sys/errno.h). X X Example: X X fopen 0 -r '/etc/passwd' X fopen 1 -w+ '/tmp/123' X fopen 2 -a 'tranact.log' X X X X 5.2.26 fputc X X usage: fputc <file> <char> X X This command writes character <char> into <file>. The <file> argument X is an integer file number representing a file opened with the fopen X command. Argument <char> is a integer value of which the lower eight X bits are used or a string value of which the first character is used. X X If a write error occurs, procedure execution is terminated. X X Example: X X $s0='abc'; fputc 1 $s0 writes 'a' X $i0=0x30 ; fputc 1 $i0 writes '0' X X X X 5.2.27 fputs X X usage: fputs [-n] <file> <str> X X This command writes the string <str> into <file>. The <file> argument X is an integer file number representing a file opened with the fopen X command. X X If the switch '-n' is omitted, a newline is appended after <str> in the X file; if present, no newline is written. X X If a write error occurs, procedure execution is terminated. X X Example: X X $s0='abc'; fputc 1 $s0 writes 'a' X X X X 5.2.28 fseek X X usage: fseek <file> <position> X X X X X Public Domain by wht@n4hgf 12/26/90 X X X X X X X X ECU Technical Description 61 X X X X This command sets the file position of <file> to <position. The X corresponding integer function %ftell may be used to determine the X current file position. X X Note: if <file> is open for append ('-a'), then the fseek command will X have no effect. X X X 5.2.29 getf X X X usage: getf -x <int-var-spec> <offset> X X where: -x == X -b byte X -w word (little-endian) X -W word (big-endian) X -l 32-bits (little-endian) X -L 32-bits (big-endian) X X X X 5.2.30 gosub X X usage: gosub <label> X X This command transfers control of procedure to a statement other than X the one immediately following. The <label> argument may be literal text X or may be a string, allowing a "computed gosub" feature. X X When the next return statement is executed, control is returned to the X next statement after the gosub. X X X X X X X X X X X X X X X X X X X X X X X Public Domain by wht@n4hgf 12/26/90 X X X X X X X X ECU Technical Description 62 X X X X Example: X X gosub GET_NEXT X gosub 'GET_NEXT' X gosub 'GET'+'_NEXT' X $s0 = 'GET_NEXT'; gosub $s0 X $s0 = 'NEXT'; gosub 'GET_'+$s0 X X Note: all the above examples cause transfer to the label GET_NEXT. X X Example: X X #--------------------- X # gosub.ep X #--------------------- X echo 'main'; gosub SUB; echo 'back to main' X return X X SUB X echo 'sub' X gosub SUB2 X echo 'back to sub' X return X X X SUB2 X echo 'sub2' X return X X X X X 5.2.31 gosubb X X usage: gosubb <label> X X This command serves the same function as the gosub command except the X programmer is signifying that the label is behind the current statement, X resulting in slightly faster execution. (The label is not REQUIRED to X be at any specific location in the procedure relative to the gosubb X statement.) X X X 5.2.32 goto X X usage: goto <label> X X This command transfers control of procedure to a statement other than X the one immediately following. The <label> argument may be literal text X or may be a string, allowing a "computed goto" feature. X X X X X Public Domain by wht@n4hgf 12/26/90 X X X X X X X X ECU Technical Description 63 X X X X Example: X X goto GET_NEXT X goto 'GET_NEXT' X goto 'GET'+'_NEXT' X $s0 = 'GET_NEXT'; goto $s0 X $s0 = 'NEXT'; goto 'GET_'+$s0 X X Note: all the above examples cause transfer to the label GET_NEXT. X X X 5.2.33 gotob X X usage: gotob <label> X X This command serves the same function as the goto command except the X programmer is signifying that the label is behind the current statement, X resulting in slightly faster execution. (The label is not REQUIRED to X be at any specific location in the procedure relative to the gotob X statement.) X X X 5.2.34 hangup X X usage: hangup X X This command causes Data Terminal Ready (DTR) to be dropped momentarily, X causing (hopefully) the termination of any current connection to a X remote system. This command is only effective if the attached Data X Communications Equipment is configured to terminate its connection on X loss of DTR. X X If no line is attached, the command is ignored (a warning is generated X if procedure tracing is enabled). X X X 5.2.35 hexdump X X usage: hexdump [-s] <str> X hexdump -t[s] <str1> <str> X X X <str> buf to dump <str1> title (if -t) -s short (terse) dump X X This command prints a hexadecimal dump of <str> on the screen (and to X the procedure log file, if logging enabled with the ptrace command). X X The switch '-t' signifies that <str1> is a title to be printed X X X X X X X Public Domain by wht@n4hgf 12/26/90 X X X X X X X X ECU Technical Description 64 X X X X Example: X X $s0='The quick brown fox jumped over the lazy dog's back' X hexdump -t 'Example hex dump' $s0 X ---------------------------- Example hex dump ---------------------------- X 0000 54 68 65 20 71 75 69 63 6B 20 62 72 6F 77 6E 20 | The quick brown | X 0010 66 6F 78 20 6A 75 6D 70 65 64 20 6F 76 65 72 20 | fox jumped over | X 0020 74 68 65 20 6C 61 7A 79 20 64 6F 67 27 73 20 62 | the lazy dog's b | SHAR_EOF true || echo 'restore of doc/ecu.man failed' echo 'End of ecuman3 part 2' echo 'File doc/ecu.man is continued in part 3' echo 3 > _shar_seq_.tmp exit 0 -------------------------------------------------------------------- Warren Tucker, TuckerWare emory!n4hgf!wht or wht@n4hgf.Mt-Park.GA.US Hacker Extraordinaire d' async PADs, pods, proteins and protocols exit 0 # Just in case... -- Kent Landfield INTERNET: kent@sparky.IMD.Sterling.COM Sterling Software, IMD UUCP: uunet!sparky!kent Phone: (402) 291-8300 FAX: (402) 291-4362 Please send comp.sources.misc-related mail to kent@uunet.uu.net.