home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
misc
/
volume21
/
ecuman
/
part03
< prev
next >
Wrap
Text File
|
1991-08-09
|
55KB
|
2,379 lines
Newsgroups: comp.sources.misc
From: Warren Tucker <wht@n4hgf.Mt-Park.GA.US>
Subject: REPOST: v21i092: Manual for ECU comm package rev 3.10, Part03/04
Message-ID: <1991Aug9.181257.28612@sparky.IMD.Sterling.COM>
X-Md4-Signature: 1118feaeee9a9ba19a99f9996df95d44
Date: Fri, 9 Aug 1991 18:12:57 GMT
Approved: kent@sparky.imd.sterling.com
Submitted-by: Warren Tucker <wht@n4hgf.Mt-Park.GA.US>
Posting-number: Volume 21, Issue 92
Archive-name: ecuman/part03
Environment: SCO, XENIX, ISC
Supersedes: ecuman3: Volume 16, Issue 22-24
[ Trouble with this getting out so lets try again... -Kent+ ]
---- Cut Here and feed the following to sh ----
#!/bin/sh
# this is ecuman310.03 (part 3 of ecuman310)
# 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" != 3; then
echo Please unpack part "$Scheck" next!
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping doc/ecu.man'
else
echo 'x - continuing file doc/ecu.man'
sed 's/^X//' << 'SHAR_EOF' >> 'doc/ecu.man' &&
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 7/25/91
X
X
X
X
X
X
X
X ECU Technical Description 59
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.4.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 7/25/91
X
X
X
X
X
X
X
X ECU Technical Description 60
X
X
X
X 5.4.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 3.2.0, 16 (1000/60) msec for
X 3.2.1 and later or any ODT 20 msec for XENIX/386 and XENIX/286). The
X 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
X
X
X Public Domain by wht@n4hgf 7/25/91
X
X
X
X
X
X
X
X ECU Technical Description 61
X
X
X
X else it is set to 0.
X
X
X
X 5.4.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.4.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.4.20 fdel
X
X usage: fdel <file>
X
X
X
X
X Public Domain by wht@n4hgf 7/25/91
X
X
X
X
X
X
X
X ECU Technical Description 62
X
X
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 /usr/include/sys/errno.h).
X
X
X Example:
X
X fdel '/tmp/123'
X
X
X
X 5.4.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.4.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
X
X
X
X
X
X Public Domain by wht@n4hgf 7/25/91
X
X
X
X
X
X
X
X ECU Technical Description 63
X
X
X
X Example:
X
X fgets 1 $s0
X
X
X
X 5.4.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.4.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.4.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
X
X
X Public Domain by wht@n4hgf 7/25/91
X
X
X
X
X
X
X
X ECU Technical Description 64
X
X
X
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 /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.4.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.4.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
X Public Domain by wht@n4hgf 7/25/91
X
X
X
X
X
X
X
X ECU Technical Description 65
X
X
X
X 5.4.28 fseek
X
X usage: fseek <file> <position>
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.4.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.4.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 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
X
X
X
X
X
X Public Domain by wht@n4hgf 7/25/91
X
X
X
X
X
X
X
X ECU Technical Description 66
X
X
X
X A switch or case function of sorts may be implimented by something like:
X
X #$i0 has been set to the "switch" value
X ifi $i0 < 0 || $i0 > 2 # avoid gosub label not found
X {
X echo 'bad my_case state value'+%itos($i0)
X DO SOMETHING LIKE DIE OR DUMP VARS AND DIE
X }
X $s0 = 'my_case_'+%itos($i0,03)
X gosub $s0
X
X my_case_000
X echo 'handle case 0'
X return
X
X my_case_001
X echo 'handle case 1'
X return
X
X my_case_002
X ifi $i_already_did_002
X {
X echo 'whoops'
X return
X }
X echo 'handle case 2'
X $i_already_did_002 = 1
X return
X
X
X
X 5.4.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.4.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
X Public Domain by wht@n4hgf 7/25/91
X
X
X
X
X
X
X
X ECU Technical Description 67
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.4.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.4.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.4.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 7/25/91
X
X
X
X
X
X
X
X ECU Technical Description 68
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 |
X 0030 61 63 6B | ack |
X
X hexdump %left($s0,9)
X 0000 54 68 65 20 71 75 69 63 6B | The quick |
X
X hexdump -ts 'Example hex dump' %left($s0,9)
X Example hex dump
X 0000 54 68 65 20 71 75 69 63 6B | The quick |
X
X hexdump -s %left($s0,9)
X 0000 54 68 65 20 71 75 69 63 6B | The quick |
X
X
X
X 5.4.36 home
X
X usage: home
X
X This command homes the video cursor.
X
X
X 5.4.37 icolor
X
X usage: icolor <int-colors>
X
X This command sets the normal and reverse foreground and background
X colors according to <int-colors>, an integer value in the format as that
X returned by the %colors integer function.
X
X This command is provided primarily to be able to save the color state,
X modify it temporarily and then restore it.
X
X Example:
X
X mkvar $icolor_save; $icolor_save = %colors
X color red; echo 'Connection seems to be dead'
X icolor $icolor_save # restore previous colors
X
X
X
X 5.4.38 ifi
X
X
X
X
X
X Public Domain by wht@n4hgf 7/25/91
X
X
X
X
X
X
X
X ECU Technical Description 69
X
X
X
X usage: ifi <int> <rel-op> <int> <statement>
X ifi <int> <rel-op> <int>
X <statement>
X ifi <int> <rel-op> <int>
X {
X any kind or number of statements
X }
X
X
X This command selectively executes one or more statements based on a test
X of two integer quantities. See the description of the break, continue,
X and else commmands for examples of how the command is used.
X
X
X 5.4.39 ifs
X
X usage: ifs <str> <rel-op> <str> <statement>
X ifs <int> <rel-op> <int>
X <statement>
X ifs <int> <rel-op> <int>
X {
X any kind or number of statements
X }
X
X
X This command selectively executes one or more statements based on a test
X of two string values. See the description of the break, continue, and
X else commmands and many other examples throughout the document, for
X examples of how the command is used.
X
X
X 5.4.40 lbreak
X
X usage: lbreak
X
X This command transmits a break to the remote system.
X
X
X 5.4.41 lgets
X
X
X usage: lgets [-er] <strvar> <t1-int> <t2-int> [<stop-str>]
X
X -e echo received characters to screen
X -r raw read (retain carriage returns)
X
X
X This command reads a string from the attached communications line.
X <t1-int> is the number of tenths of seconds before timing out waiting
X for the first character to be received. <t2-int> is the number of
X tenths of seconds before timing out on later characters. <stop-str> is
X
X
X
X Public Domain by wht@n4hgf 7/25/91
X
X
X
X
X
X
X
X ECU Technical Description 70
X
X
X
X an optional argument, which if received, immediately terminates the
X read. Integer variable $i0 is set to the count of characters received.
X
X If the specified string variable is filled with characters before the
X <stop-str> has been encountered or before a timeout occurs, then the
X command returns with $i0 set to the maximum size of the variable. Refer
X to the section on string variables above and the section describing the
X mkvar command below for information on the size of string variables.
X
X
X 5.4.42 insline
X
X usage: insline
X
X This command inserts a line onto the video screen at the current line.
X
X
X 5.4.43 logevent
X
X usage: logevent <str>
X
X
X This command writes a log item to ~/.ecu/log.
X
X
X Example:
X
X $s0='/tmp/alm.log'
X log 'appending alarm info to '+$s0
X
X writes:
X 10-02-1989-17:39-01261-PROC appending alarm info to /tmp/alm.log
X
X assuming the transmitter process pid is 1261 and you are living in 1989.
X
X 5.4.44 lookfor
X
X lookfor [-e] [quiet | <str>] [<timeout-int>]
X
X -e echo to screen while "looking"
X
X This command is used to read from the attached commuications line until
X one of two user-specified conditions occurs.
X
X The 'quiet' option waits for the line to become quiet for the number of
X tenths of seconds specified by <timeout-int>.
X
X The other option reads the line until <str> is read from the line or
X until <timeout-int> tenths of seconds elapses. With this option,
X integer variable $i0 is set to 1 if <str> is found within the timeout
X period or 0 if not.
X
X
X
X Public Domain by wht@n4hgf 7/25/91
X
X
X
X
X
X
X
X ECU Technical Description 71
X
X
X
X Examples:
X
X lookfor -e quiet 20 wait for quiet line for 2 secs
X lookfor 'word:' 50 wait for 'word:' for up to 5 secs
X
X 5.4.45 mkvar
X
X usage: mkvar [$]i<name>
X mkvar [$]s<name>(<size>)
X
X
X This command creates one or more named (temporary) integer or string
X variables. The variable type is determines by the first character of
X the variable, which must be 'i' or 's'. The size of a string variable
X must be specified via the <size> argument. An optional '$' may be
X supplies for neatness, but may be omitted if desired.
X
X
X 5.4.45.1 Variable Names
X
X The names for created (named, temporary) variables consist of a dollar
X sign ('$'), an 'i' for integer or 's' for string and up to fifteen
X characters from the set [A-Za-z0-9_].
X
X The first character after the 'i' or 's' in <name> must be non-numeric.
X '$sxyz' and '$s_3xyz' are legal, but '$s3xyz' is not (it would be
X interpreted as '$s3' followed by the illegal command sequence 'xyz').
X
X The <name> space for integer and string variables are separate. It is
X possible to have an integer variable named '$ixyz' and a string variable
X named '$sxyz'.
X
X
X 5.4.45.2 Variable Life and Scope
X
X The life and scope of created variables is for the duration of the
X execution of the creating procedure. Procedures called by the creating
X procedure (by 'do') can reference temporary variables declared by a
X previous procedure. When created, integer variables are set to zero and
X string variables are set to zero length. These features differ from
X numbered variables which retain their scope and values at all times,
X even when procedure execution terminates and ECU returns to interactive
X mode.
X
X Variables may be created by the same name more than once. The latest
X mkvar execution specifies the variable referenced. Thus if proc1
X declares '$ixx' and calls proc2 which also declares '$ixx', proc2's
X variable is distinct from proc1's and disappears when proc2 terminates,
X thus making proc1's available to it again, containing the same value as
X it had at the time proc2 was called.
X
X
X
X
X Public Domain by wht@n4hgf 7/25/91
X
X
X
X
X
X
X
X ECU Technical Description 72
X
X
X
X 5.4.45.3 String Variable Size
X
X The maximum value for <size> is 5120. Regardless of the size specified
X in the creation of a string variable, ECU will expand it's size as
X necessary up to the 5120 character maximum.
X
X
X Examples:
X
X mkvar i_count
X mkvar $i_count
X mkvar s20(20),s80(80),i_timeout,$i_colors
X
X
X
X 5.4.46 nap
X usage: nap <int>
X nap -m <int>
X
X This command suspends procedure execution for <int> tenths of seconds if
X -m is not specified. If -m is used, execution is suspended for <int>
X milliseconds. Note: the actual period execution is suspended depends,
X as usual, on the scheduling load of the system. For small -m values, be
X aware that the granularity of the nap duration is set by the system, 20
X milliseconds for XENIX 286 and 386, 10 milliseconds for UNIX.
X
X If you need to know the frequency of the system clock, something like
X
X $i0 = %stoi(%getenv("HZ"))
X
X will obtain the value for you (provided HZ is in the process'
X environment).
X
X
X
X Examples:
X
X nap 30
X nap $i0*$i2
X nap -m 50
X
X
X
X 5.4.47 nice
X usage: nice <int>
X
X This command sets the nice value of the process. It behaves exactly
X like the nice(S) or nice(2) system call. The <int> parameter must be in
X the range 0 through 39, inclusive. If the call fails, a warning is
X printed and the procedure continues to execute. The current nice value
X may be obtained using the %nice integer function. See also the
X
X
X
X Public Domain by wht@n4hgf 7/25/91
X
X
X
X
X
X
X
X ECU Technical Description 73
X
X
X
X description of the nice interactive command.
X
X
X 5.4.48 parity
X
X usage: parity [even | odd | none]
X parity <str>
X
X
X This command sets the parity for the attached communications line. If
X <str> is supplied, the first character must be 'e', 'o' or 'n'.
X Uppercase equivalents are also accepted.
X
X
X Examples:
X
X parity even
X parity 'e'
X parity 'Even now as we speak'
X
X
X
X 5.4.49 pclose
X usage: pclose <filenum>
X
X This command should be issued when a command started by the interactive
X popen commandf completes.
X
X
X 5.4.50 plog
X
X usage: plog
X plog <str>
X plog off
X
X
X This command controls logging to a file of the screen output during
X procedure execution. With no argument, the command displays the status
X of logging. <str> specifies a log file pathname, while the 'off'
X argument turns logging off.
X
X If procedure execution terminates due to an error, procedure logging is
X turned off. However, if procedure execution terminates normally while
X logging is active, erratic and unpredictable portions of interactive
X mode screen output will continue to be logged to the current log file.
X
X The interactive mode command plog may also be used to control procedure
X logging.
X
X
X
X
X
X
X Public Domain by wht@n4hgf 7/25/91
X
X
X
X
X
X
X
X ECU Technical Description 74
X
X
X
X Example:
X
X mkvar s_logname(128)
X $s_logname = %dir+'logname'
X plog $s_logname
X echo 'Test'
X plog off;cd 'somewhere_else';plog $s_logname
X echo 'Test'
X
X
X
X 5.4.51 popd
X
X usage: popd [ | <#> | all]
X
X
X This command returns to a previous directory after a pushd command has
X been previously executed.
X
X If no argument is supplied, the directory at the immediately previous
X level is restored.
X
X If a numeric argument is supplied, the directory at the specified level
X is restored; the level numbers may be obtained by issuing a pushd
X command with no arguments.
X
X If the 'all' argument is supplied, it is treated as a numeric argument
X of 0; that is the directory stack is cleared and the directory at level
X 0 is restored.
X
X The directory stack is shared between interactive and procedure
X commands. Neither beginning nor ending a procedure affects the
X directory stack level.
X
X
X Examples:
X popd
X popd 3
X popd all
X
X
X
X 5.4.52 popen
X usage: popen [-switches] <filenum> <command>
X
X This command executes a shell command defined by the string argument
X <command> and associates it with the user-chosen file number <filenum>
X (which must be an integer value between 0 and 4, inclusive).
X
X The argument switches govern whether the command is to receive input
X from ECU or output to ECU and must be chosen from this list:
X
X
X
X Public Domain by wht@n4hgf 7/25/91
X
X
X
X
X
X
X
X ECU Technical Description 75
X
X
X
X -r The command will output to ECU.
X
X -w The command will receive input from ECU.
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 /usr/include/sys/errno.h).
X
X Example:
X
X popen 0 -r 'ls -l *.log'
X popen 1 -w 'cat | sort > /tmp/sorted'
X
X
X
X
X 5.4.53 prompt
X usage: prompt <str>
X
X This command allows selection of an alternate prompt to the interactive
X mode HOME command trigger. Refer to the section titled "ECUPROMPT" for
X more information on the interactive mode prompt.
X
X Note: the interactive and procedure hangup commands both cause the
X default prompt to be reestablished.
X
X
X Example:
X
X prompt %rname+' >' use remote name in prompt
X
X
X
X 5.4.54 ptrace
X
X usage: ptrace [ <str> | off ]
X
X
X This command controls procedure execution tracing. Trace output is
X written to the screen and varys in its nature depending upon the command
X being traced. Specifically, any change to a string or integer variable
X is noted. If tracing is enabled, the output will also be written to any
X active procedure log file (see the plog interactive and procedure
X commands).
X
X
X
X
X
X Public Domain by wht@n4hgf 7/25/91
X
X
X
X
X
X
X
X ECU Technical Description 76
X
X
X
X 5.4.55 pushd
X
X usage: pushd [ | <dir>]
X
X
X This command either 1) saves the current directory pathname on a stack
X and establishes a new current directory or 2) displays the current stack
X and current directory. The stack size is 10.
X
X If no argument is supplied, the directory stack is displayed.
X
X The directory stack is shared between interactive and procedure
X commands. Neither beginning nor ending a procedure affects the
X directory stack level.
X
X
X Examples:
X pushd
X pushd '/tmp'
X
X
X
X 5.4.56 putf
X
X Not yet implemented.
X
X
X 5.4.57 return
X usage: return [<int>]
X
X This command serves two functions: to return from a gosub to or return
X from a procedure execution. If <int> is supplied, it must be in the
X range 0 to 255. Other values result in a return value of 255.
X
X If no gosub is active, return causes the currently executing procedure
X to terminate, returning either to a calling procedure or to the
X interactive mode. If <int> is supplied and it's value is nonzero, then
X all procedure execution is terminated and the integer status is printed
X on the screen along with the name of the executing procedure.
X
X If a gosub is active, return or return 0 causes control to return to the
X statement immediately following the gosub which invoked the subroutine.
X If <int> is supplied and it's value is nonzero, then all procedure
X execution is terminated and the integer status is printed on the screen
X along with the name of the executing procedure.
X
X It is not possible to terminate a procedure with normal status from
X within a subroutine.
X
X
X
X
X
X
X Public Domain by wht@n4hgf 7/25/91
X
X
X
X
X
X
X
X ECU Technical Description 77
X
X
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.4.58 rk
X usage: rk [-a]
X
X This command invokes the Kermit file receive protocol. If switch '-a'
X is omitted, the received files are stored as received; otherwise
X carriage return/linefeed pairs are converted to newlines. The remote
X sender must have been started prior the the execution of this command.
X
X
X 5.4.59 rlog
X
X usage: rlog [-srf] <str>
X rlog 'off'
X
X
X This command controls receiver logging. It's function is the same as
X the interactive log command.
X
X The first form of the command enables logging. The -
X sswitchcausesthefiletobe scratched when it is opened (otherwise the file
X is opened for append). The -r switch causes raw logging, else filter
X logging is performed. The -f switch causes the log file to be flushed
X each time it is written to (unbuffered I/O); this switch is useful if
X you are logging to a terminal or hard copy device and wish to see output
X as soon as it is produced.
X
X
X
X
X
X
X
X Public Domain by wht@n4hgf 7/25/91
X
X
X
X
X
X
X
X ECU Technical Description 78
X
X
X
X 5.4.60 rname
X usage: rname <str>
X
X Normally, the %rname string function returns the same string as the
X logical dialing directory entry. This command allows the default value
X to be overridden with a user-selected value (63-character maximum).
X
X This feature is useful in situations where one system is initially
X dialed, but a connection is made to yet another system from the dialed
X system via networking.
X
X
X 5.4.61 rs
X usage: rs
X
X This command invokes the SEAlink file receive protocol. There is no
X provision in the SEAlink protocol to convert carriage return/linefeed
X pairs to newlines, so the received files are stored as received. The
X remote sender must have been started prior the the execution of this
X command.
X
X
X 5.4.62 rtscts
X usage: rtscts [ off| on | no | yes | 0 | 1 | 2 | 3 ]
X
X This SCO-only command control RTS/CTS hardware flow control, which may
X or may not work with your serial driver. What the command does is to
X manipulate the RTSFLOW and CTSFLOW bits of the termio c_cflag word (see
X termio(S)).
X
X As of this writing, SCO's driver does half duplex (traditional, brain
X damaged) flow control if RTSFLOW is enabled. FAS does hardware flow
X control based on the device magic number, but if you use a device number
X specifying no hardware flow control, RTSFLOW and CTSFLOW can be used to
X specify SCO-style flow control. Advice: use rts on or off for SCO, use
X appropriate magic numbered device for FAS.
X
X
X argument | RTSFLOW | CTSFLOW argument | RTSFLOW | CTSFLOW
X ---------+---------+--------- ---------+---------+---------
X off | 0 | 0 0 | 0 | 0
X on | 0 | 1 1 | 0 | 1
X no | 0 | 0 2 | 1 | 0
X yes | 1 | 1 3 | 1 | 1
X
X
X
X
X
X
X
X
X
X
X Public Domain by wht@n4hgf 7/25/91
X
X
X
X
X
X
X
X ECU Technical Description 79
X
X
X
X 5.5 Integer Functions
X
X
X
X 5.5.1 %argc
X
X This function returns the number of arguments passes to the current
X procedure.
X
X
X
X
X 5.5.2 %baud
X
X This function returns the baud rate of the communications line. If no
X line is currently attached, the baud rate returned is the value of the
X last line attached. If no line has been attached during the current
X session, the default baud rate is returned.
X
X
X 5.5.3 %colors
X
X This function returns the state of the normal and reverse video
X foreground and background colors in the 32-bit value:
X
X 00000000001111111111222222222233
X 01234567890123456789012345678901
X 0000|--|0000|--|0000|--|0000|--|
X fg bk fg bk
X reverse normal
X
X
X The color values are obtained from the following lists:
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 7/25/91
X
X
X
X
X
X
X
X ECU Technical Description 80
X
X
X
X Alphabetic Order
X black 0
X blue 1
X brown 6
X cyan 3
X gray 8
X green 2
X hi_white 15
X lt_blue 9
X lt_cyan 11
X lt_green 10
X lt_magenta 13
X lt_red 12
X magenta 5
X red 4
X white 7
X yellow 14
X
X
X
X Numeric Order
X black 0
X blue 1
X green 2
X cyan 3
X red 4
X magenta 5
X brown 6
X white 7
X gray 8
X lt_blue 9
X lt_green 10
X lt_cyan 11
X lt_red 12
X lt_magenta 13
X yellow 14
X hi_white 15
X
X
X
X 5.5.4 %cols
X
X This function returns the screen width in columns. If running non-
X interactively, the value will always be 80.
X
X
X 5.5.5 %conn
X
X This function returns the communications line file descriptor if a
X connection is in progress, else 0. NOTE: if carrier is lost
X abnormally, %conn will return non-zero incorrectly.
X
X
X
X Public Domain by wht@n4hgf 7/25/91
X
X
X
X
X
X
X
X ECU Technical Description 81
X
X
X
X 5.5.6 %curx
X
X This function returns the display cursor column position last set by the
X remote system. This value does not reflect the actual hardware cursor.
X
X
X 5.5.7 %cury
X
X This function returns the display cursor row position last set by the
X remote system. This value does not reflect the actual hardware cursor.
X
X
X 5.5.8 %csec
X
X This function returns the number of seconds ECU has been connected to a
X remote system. If ECU is not connected, zero is returned.
X
X
X 5.5.9 %ctoi
X
X usage: %ctoi(str0)
X
X This function returns the integer value of the first character in string
X str0. If str0 is non-empty, the return value will be between 0 and 255,
X inclusive. if str0 is empty, then -1 is returned.
X
X
X 5.5.10 %esecs
X
X usage: %esecs
X
X This function , "Epoch SECondS," returns the number of seconds since
X January 1, 1970 00:00 UTC (GMT).
X
X
X 5.5.11 %fatime
X
X usage: %fatime(int0)
X %fatime(str0)
X
X
X This function returns the time of last access of the file referenced by
X the argument. If the argument is an integer, the file referenced is the
X file opened by that number with the fopen command. If the argument is a
X string, it is the literal filename.
X
X If int0 does not refer to an open file, the procedure terminates with an
X error. If the file specified by str0 does not exist, -1 is returned.
X
X The return value is the number of seconds since January 1, 1970 at 0000
X UTC. The %edate string function may be used to convert the integer
X
X
X
X Public Domain by wht@n4hgf 7/25/91
X
X
X
X
X
X
X
X ECU Technical Description 82
X
X
X
X value to a string representation of the date and time expressed relative
X to the current time zone.
X
X
X 5.5.12 %fmode
X
X usage: %fmode(int0)
X %fmode(str0)
X
X
X This function returns the file mode value ("rwxrwx---" == 077) of the
X file referenced by the argument. If the argument is an integer, the
X file referenced is the file opened by that number with the fopen
X command. If the argument is a string, it is the literal filename.
X
X If int0 does not refer to an open file, the procedure terminates with an
X error. If the file specified by str0 does not exist, -1 is returned.
X
X
X 5.5.13 %fmtime
X
X usage: %fmtime(int0)
X %fmtime(str0)
X
X
X This function returns the time of last modified of the file referenced
X by the argument. If the argument is an integer, the file referenced is
X the file opened by that number with the fopen command. If the argument
X is a string, it is the literal filename.
X
X If int0 does not refer to an open file, the procedure terminates with an
X error. If the file specified by str0 does not exist, -1 is returned.
X
X The return value is the number of seconds since January 1, 1970 at 0000
X UTC. The %edate string function may be used to convert the integer
X value to a string representation of the date and time expressed relative
X to the current time zone.
X
X
X 5.5.14 %fmode
X
X usage: %fmode(int0)
X %fmode(str0)
X
X
X This function returns the size of the file referenced by the argument.
X If the argument is an integer, the file referenced is the file opened by
X that number with the fopen command. If the argument is a string, it is
X the literal filename.
X
X If int0 does not refer to an open file, the procedure terminates with an
X
X
X
X Public Domain by wht@n4hgf 7/25/91
X
X
X
X
X
X
X
X ECU Technical Description 83
X
X
X
X error. If the file specified by str0 does not exist, -1 is returned.
X
X
X 5.5.15 %ftell
X
X usage: ftell(int0)
X
X This function returns the current file position of the the file opened
X by int0 with the fopen command.
X
X If int0 does not refer to an open file, the procedure terminates with an
X error.
X
X
X 5.5.16 %instr
X
X usage: %instr(str0,str1)
X
X This function returns the leftmost column position withing str0 that
X str1 is found (zero relative). If str1 cannot be found in string str0,
X -1 is returned. However, if str1 is null and str0 is not, zero will be
X returned (i.e., the null string matches at the left).
X
X The comparison is made without regard to case. See also %instr.
X
X
X Examples:
X
X 00000000001111111
X 01234567890123456
X Assume $s0='abcdefghijklmnabc'
X $s1='abc'
X $s2='gHi'
X $s3='cat'
X
X %instr($s0,$s1) returns 0
X %instr($s0,$s2) returns 6
X %instr($s0,$s3) returns -1
X %instr($s0,'bcd') returns 2
X %instr($s0,'bad') returns -1
X
X
X
X 5.5.17 %ischr
X
X usage: %ischr(int0)
X %ischr(str0)
X
X
X This function returns 1 if the file referenced by the argument is a
X character special file, else 0. If the argument is an integer, the file
X
X
X
X Public Domain by wht@n4hgf 7/25/91
X
X
X
X
X
X
X
X ECU Technical Description 84
X
X
X
X referenced is the file opened by that number with the fopen command. If
X the argument is a string, it is the literal filename.
X
X If int0 does not refer to an open file, the procedure terminates with an
X error. If the file specified by str0 does not exist, -1 is returned.
X
X Examples:
X
X
X %ischr('/dev/tty') returns 1
X %ischr('/usr/bin') returns 0
X %ischr('/xenix') returns 0
X
X
X
X 5.5.18 %isdir
X
X usage: %isdir(int0)
X %isdir(str0)
X
X
X This function returns 1 if the file referenced by the argument is a
X directory file, else 0. If the argument is an integer, the file
X referenced is the file opened by that number with the fopen command. If
X the argument is a string, it is the literal filename.
X
X If int0 does not refer to an open file, the procedure terminates with an
X error. If the file specified by str0 does not exist, -1 is returned.
X
X Examples:
X
X
X %isdir('/dev/tty') returns 0
X %isdir('/usr/bin') returns 1
X %isdir('/xenix') returns 0
X
X
X
X 5.5.19 %isreg
X
X usage: %isreg(int0)
X %isreg(str0)
X
X
X This function returns 1 if the file referenced by the argument is a
X regular file, else 0. If the argument is an integer, the file
X referenced is the file opened by that number with the fopen command. If
X the argument is a string, it is the literal filename.
X
X If int0 does not refer to an open file, the procedure terminates with an
X error. If the file specified by str0 does not exist, -1 is returned.
X
X
X
X Public Domain by wht@n4hgf 7/25/91
X
X
X
X
X
X
X
X ECU Technical Description 85
X
X
X
X Examples:
X
X
X %isreg('/dev/tty') returns 0
X %isreg('/usr/bin') returns 0
X %isreg('/xenix') returns 1
X
X
X
X 5.5.20 %len
X
X usage: %len(str0)
X
X This function returns the length of str0.
X
X Example:
X
X set str0='abcdef',i0=%len(str0),i1=%len('1234')
X str00 = 'abcdef'
X int00 = 6
X int01 = 4
X
X
X
X 5.5.21 %lgetc
X
X usage: %lgetc
X
X Reads a character from the line and returns it.
X
X
X 5.5.22 %lines
X
X This function returns the screen height in lines. If running non-
X interactively, the value will always be 25.
X
X
X 5.5.23 %nice
X
X usage: %nice
X
X This function returns the nice value of the ECU process.
X
X
X 5.5.24 %pid
X
X This function returns the process id (pid) of ECU.
X
X
X
X
X
X
X
X Public Domain by wht@n4hgf 7/25/91
X
X
X
X
X
X
X
X ECU Technical Description 86
X
X
X
X 5.5.25 %match
X
X usage: %match(str0,str1)
X
X This function searches string str0 for a match with the regular
X expression in str1 (for information on regular expressions, refer to the
X ed(C) manual pages). The function returns the index into str0 where the
X match is found or -1 if no match can be found. The matching process is
X case sensitive.
X
X The variable $i0 receives the length of the matching string in str0 if a
X match is found. For this reason, it is not advisable that $i0 otherwise
X be involved in the operation. Specifically to be avoided is:
X
X set $i0=%instr(...)
X
X Examples:
X
X 00000000001111111
X 01234567890123456
X Assume $s0='abcdefghijklmnabc'
X $s1='abc'
X $s2='n.*'
X
X %match($s0,$s1) returns 0 $i0=3
X %match($s0,$s2) returns 16 $i0=4
X %match($s0,$s3) returns -1 $i0 unchanged
X %match($s0,'de..h') returns 3 $i0=5
X %match($s0,'de..H') returns -1 $i0 unchanged
X
X
X
X 5.5.26 %mhack
X
X usage: %mhack
X
X This function ("Millisecond time HACK") returns the number of
X milliseconds since ecu was started. It isn't a very useful value by
X itself, but differences between the values returned by two calls to the
X function may be used to determine the time between two events with the
X maximum accuracy the operating system can deliver (1/HZ resolution with
X a bit of latency).
X
X
X Examples:
X $i10 = %mhack
X send 'test'
X lookfor -e %chr(0x0A) 100
X ifi $i0 == 0 echo 'no response in 10 seconds'
X else echo 'response time '+%itos(%mhack - $i10)+' msec'
X
X
X
X
X Public Domain by wht@n4hgf 7/25/91
X
X
X
X
X
X
X
X ECU Technical Description 87
X
X
X
X 5.5.27 %rchr
X
X This function returns the number of characters received by ECU since the
X program starrted.
X
X
X 5.5.28 %rchrc
X
X This function returns the number of characters received by ECU during
X the current connection.
X
X
X 5.5.29 %rinstr
X
X usage: %rinstr(str0,str1)
X
X This function returns the rightmost column position withing str0 that
X str1 is found (zero relative). If str1 cannot be found in string str0,
X -1 is returned. However, if str1 is null and str0 is not, zero will be
X returned (i.e., the null string matches at the left).
X
X The comparison is made without regard to case. See also %instr.
X
X
X Examples:
X
X 00000000001111111
X 01234567890123456
X Assume $s0='abcdefghijklmnabc'
X $s1='abc'
X $s2='gHi'
X $s3='cat'
X
X %instr($s0,$s1) returns 14
X %instr($s0,$s2) returns 6
X %instr($s0,$s3) returns -1
X
X
X
X 5.5.30 %shmid
X
X This function returns the integer shared memory segment id for the
X current ECU process. It may be used to pass the id to a "friend"
X process so that it may access the shared memory segment (described in
X header file ecushm.h). For more details, refer to an earlier section
X entitled "Shared Memory 'Friend' Interface."
X
X
X
X
X
X
X
X
X Public Domain by wht@n4hgf 7/25/91
X
X
X
X
X
X
X
X ECU Technical Description 88
X
X
X
X Example:
X
X system 'ecufriend '+%itos(%shmid)
X
X
X
X 5.5.31 %stoi
X
X usage: %stoi(str0)
X
X This function converts the contents of str0 to an integer and returns
X the value.
X
X
X 5.5.32 %uid
X
X usage: %uid
X
X This function returns the uid of the user.
X
X
X 5.5.33 %xchr
X
X This function returns the number of characters transmitted by ECU since
X the program starrted.
X
X
X 5.5.34 %xchrc
X
X This function returns the number of characters transmitted by ECU during
X the current connection.
X
X
X
X
X 5.6 String Functions
X
X
X
X 5.6.1 %argv
X
X usage: %argv(int0)
X
X This function returns the string value of an argument passed to the
X procedure by the 'do' command. Argument 0 is the name of the procedure
X itself. The integer function %argc may be used to determine the number
X of arguments passed to the procedure. Specifying an argument number
X greater than the number of arguments passed returns a null string (if
X procedure tracing is enabled with the 'ptrace' comand, a warning will be
X displayed in this case).
X
X
X
X
X Public Domain by wht@n4hgf 7/25/91
X
X
X
X
X
X
X
X ECU Technical Description 89
X
X
X
X Example:
X invocation from shell:
X ecu -p test Quick Brown Fox
X
X invocation from interactive command line:
X do test Quick Brown Fox
X
X invocation from procedure:
X do 'test' 'Quick' 'Brown' 'Fox'
X
X results in:
X %argv(0) = 'test'
X %argv(1) = 'Quick'
X %argv(2) = 'Brown'
X %argv(3) = 'Fox'
X %argv(4) = ''
X
X
X NOTE: the interactive dial command, the dialing directory menu and the
X initial setup menu all can automatically execute a procedure which
X matches a dialed logical telephone number. There two arguments passed
X to these procedures, %argv(0) being the procedure name as always.
X %argv(1) is set according to the following table:
X
X invoker %argv(1)
X ------------------- -------------
X initial setup menu !INITIAL
X interactive dial !INTERACTIVE
X dialing menu !MENU
X
X Thus it is possible for the invoked procedure to determine that it has
X been automatically executed by testing %argv(1) for an exclamation
X point, or possibly the entire argument.
X
X
X 5.6.2 %basename
X
X Usage: %basename(str0,str1)
X
X This function is similar to the UNIX basename(1) utility in that it
X returns a filename minus a supplied suffix, if it is present. Unlike
X the UNIX basename(C) program, %basename does not remove the directory
X part of the filename. See also %dirpart and %filepart.
X
X
X Examples:
X
X %basename('/u1/src/ecu/ecu.c','.c') = /u1/src/ecu/ecu
X %basename('ecu.c','.c') = ecu
X %basename('ecu.c','.x') = ecu.c
X
X
X
X
X Public Domain by wht@n4hgf 7/25/91
X
X
X
X
X
X
X
X ECU Technical Description 90
X
X
X
X 5.6.3 %cgetc
X
X usage: %cgetc
X
X This function reads one character from the console keyboard and returns
X it. The character is not echoed.
X
X
X 5.6.4 %cgets
X
X usage: %cgets
X
X This function reads a string from the console keyboard and returns it.
X Each character is echoed as it is typed and the user's normal erase and
X kill character is available to edit the input before terminating the
X read with ENTER.
X
X
X 5.6.5 %chr
X
X usage: %chr(int0)
X
X This function returns the character value whose ASCII value is supplied
X in int0.
X
X
X Example:
X
X set $s0 = %chr(4) places a ^D (EOT) character into $s0
X
X
X
X 5.6.6 %date
X
X usage: %date
X
X This function returns the current date in the form 'mm-dd-yyyy' in the
X local time zone (daylight time if it applies).
X
X
X 5.6.7 %datez
X
X usage: %datez
X
X This function returns the current date in the form 'mm-dd-yyyy' in the
X UTC (Z) time zone.
X
X
X 5.6.8 %day
X
X usage: %day
X
X
X
X Public Domain by wht@n4hgf 7/25/91
X
X
X
X
X
X
X
X ECU Technical Description 91
X
X
X
X This function returns the current day of the week as a three character
X abbreviation: 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' in the
X local time zone (daylight time if it applies).
X
X
X 5.6.9 %dayz
X
X usage: %dayz
X
X This function returns the current day of the week as a three character
X abbreviation: 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' in the UTC
X (Z) time zone.
X
X
X 5.6.10 %dir
X
X usage: %dir
X
X This function returns the full pathname of the current working
X directory.
X
X
X 5.6.11 %dirpart
X
X usage: %dirpart(str0)
X
X This function returns the directory portion of the pathname supplied in
X str0. See also %basename and %filepart.
X
X
X
X Examples:
X
X %dirpart('/u1/src/src/foo.c') = "/u1/src/src"
X %dirpart('foo.c') = "foo.c"
X %dirpart('/usr') = ""
X
X
X
X 5.6.12 %edate
X
X usage: %edate(int0)
X
X The value in int0 is expected to be a number of seconds since January 1,
X 1970 00:00 UTC (Universal Coordinated Time) as returned by the integer
X functions %fatime and %fmtime. This function converts the value into a
X string representing the equivalent local time in the form 'mm-dd-yyyy
X hh:mm:ss'.
X
X
X
X
X
X
X Public Domain by wht@n4hgf 7/25/91
X
X
X
X
X
X
X
X ECU Technical Description 92
X
X
X
X Example:
X
X set $i0=%fmtime('/xenix')
X $i00 = 601178971 (0x23d5435b,04365241533)
X
X set $s0=%edate($i0)
X $s00 = '01-18-1989 21:09:31'
X
X
X
X 5.6.13 %envvar
X
X usage: %envvar()
X
X This function returns the string value of an environment variable.
X
X
X Example:
X
X set $s0=%envvar('HOME') might set $s0 '/usr/user'
X
X Typical Environment Variables:
X
X HOME pathname of home directory
X EDITOR user's preferred editor
X PATH program execution searchlist
X TERM terminal type
X SHELL user's preferred shell
X MAIL user's mail box file
X ECUPROMPT ECU interactive command prompt
X at beginning of execution
X
X
X
X 5.6.14 %errstr
X
X usage: %errstr(int0)
X
X This function returns the system error message, given int0 as an errno
X as returned by a file-related command. fopen.
X
X
X Example:
X
X echo %errstr(1)
X Not owner
X
X
X
X
X
X
X
X
X Public Domain by wht@n4hgf 7/25/91
X
X
X
X
X
X
X
X ECU Technical Description 93
X
X
X
X 5.6.15 %etime
X
X usage: %etime(int0)
X
X This function returns a string representation of elapsed time in the
SHAR_EOF
true || echo 'restore of doc/ecu.man failed'
fi
echo 'End of ecuman310 part 3'
echo 'File doc/ecu.man is continued in part 4'
echo 4 > _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.