ecu - SCO XENIX V/{2,3}86 Extended CU part 44/47
Warren Tucker
wht at tridom.uucp
Thu Oct 12 05:20:48 AEST 1989
---- Cut Here and unpack ----
#!/bin/sh
# this is part 44 of a multipart archive
# do not concatenate these parts, unpack them in order with /bin/sh
# file doc/ecu.man continued
#
CurArch=44
if test ! -r s2_seq_.tmp
then echo "Please unpack part 1 first!"
exit 1; fi
( read Scheck
if test "$Scheck" != $CurArch
then echo "Please unpack part $Scheck next!"
exit 1;
else exit 0; fi
) < s2_seq_.tmp || exit 1
echo "x - Continuing file doc/ecu.man"
sed 's/^X//' << 'SHAR_EOF' >> doc/ecu.man
X tenths of seconds before timing out on later characters. <stop-str> is
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
X 6.2.35 _l_o_g_e_v_e_n_t
X
X usage: logevent <str>
X
X
X This command writes a log item to ~/.ecu/log.
X
X
X
X
X
X
X
X
X
X Copyright (C) 1989, Warren H. Tucker 10/8/89
X
X
X
X
X
X
X
X ECU Technical Description 48
X
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 6.2.36 _l_o_o_k_f_o_r
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 becomes quiet for the number of tenths of
X 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 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 6.2.37 _m_k_v_a_r
X
X usage: mkvar [$]i<name>
X mkvar [$]s<name>(<size>)
X
X
X This command creates one or more named integer or string variables. The
X variable type is determines by the first character of the variable,
X which must be 'i' or 's'. The size of a string variable must be
X specified via the <size> argument. An optional '$' may be supplies for
X neatness, but may be omitted if desired.
X
X The maximum value for <size> is 5120. Note that most commands are not
X capable of handling variables longer in current length than 256.
X Procedures employing created string variables longer than 256 characters
X should be tested carefully with string lengths that exceed 256.
X
X The scope of created variables is for the duration of the execution of
X the creating procedure. Procedures called by the creating procedure (by
X 'do') can reference created variables. When created, integer variables
X
X
X
X Copyright (C) 1989, Warren H. Tucker 10/8/89
X
X
X
X
X
X
X
X ECU Technical Description 49
X
X
X
X are set to zero and string variables are set to zero length. These
X features differ from numbered variables which retain their scope and
X values at all times, even when procedure execution terminates and ECU
X returns to interactive mode.
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'. <name> may contain any alphabetic or numeric character
X or the underscore ('_') character, but must begin with a non-numeric
X character. '$s_xyz' and '$sxyz' or legal, but '$s3xyz' is not (would be
X interpreted as '$s3' followed by the illegal command sequence 'xyz').
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 Examples:
X
X mkvar i_count
X mkvar $i_count
X mkvar s20(20),s80(80),i_timeout,$i_colors
X
X
X
X 6.2.38 _n_a_p
X usage: nap <int>
X
X This command suspends procedure execution for <int> tenths of seconds.
X
X
X Examples:
X
X nap 30
X nap $i0*$i2
X
X 6.2.39 _p_a_r_i_t_y
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
X
X
X
X Copyright (C) 1989, Warren H. Tucker 10/8/89
X
X
X
X
X
X
X
X ECU Technical Description 50
X
X
X
X Examples:
X
X parity even
X parity 'e'
X parity 'Even now as we speak'
X
X
X
X 6.2.40 _p_l_o_g
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 may also be used to control procedure
X logging.
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
X 6.2.41 _p_r_o_m_p_t
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 commands both cause the default
X prompt to be reestablished.
X
X
X
X
X
X Copyright (C) 1989, Warren H. Tucker 10/8/89
X
X
X
X
X
X
X
X ECU Technical Description 51
X
X
X
X Example:
X
X prompt %rname+' >' use remote name in prompt
X
X
X
X 6.2.42 _p_t_r_a_c_e
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 interactive and procedure commands).
X
X
X 6.2.43 _r_e_t_u_r_n
X usage: return [<int>]
X
X This command causes the currently executing procedure to terminate,
X returning either to a calling procedure or to the interactive mode. If
X <int> is supplied, if it nonzero, then all procedure execution is
X terminated and the integer status is printed on the screen along with
X the name of the executing procedure.
X
X
X 6.2.44 _r_k
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 6.2.45 _r_s
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 6.2.46 _r_x
X usage: rx [-a] <str>
X
X This command invokes the XMODEM file receive protocol to receive file
X
X
X
X Copyright (C) 1989, Warren H. Tucker 10/8/89
X
X
X
X
X
X
X
X ECU Technical Description 52
X
X
X
X <str>. If switch '-a' is omitted, the received file is stored as
X received; otherwise carriage return/linefeed pairs are converted to
X newlines. The remote sender must have been started prior the the
X execution of this command.
X
X
X 6.2.47 _r_y
X usage: ry
X
X This command invokes the YMODEM Batch (not to be confused with XMODEM-
X 1K) protocol to receive files from a remote system. The remote sender
X must have been started prior the the execution of this command.
X
X
X 6.2.48 _r_z
X usage: rz
X
X This command invokes the ZMODEM protocol to receive files from a remote
X system. The remote sender must have been started prior the the
X execution of this command.
X
X
X 6.2.49 _s_c_r_d_u_m_p
X usage: scrdump [<str>]
X
X This command causes the current screen contents to be stored in a file.
X If <str> is supplied, it is used as a pathname. If <str> is not
X supplied, "~/.ecu/screen.dump". The actions of the interactive command
X have no effect on the execution of this command.
X
X
X 6.2.50 _s_e_n_d
X usage: send [-n] <str>
X
X This command sends <str> to the communications line. If the '-n' switch
X is omitted, a carriage return (0x0D) is transmitted after <str>. If '-
X n' is supplied, no carriage return is transmitted.
X
X
X Examples:
X
X send 'ps -au'
X send -n %chr(0x02)+"START'+%chr(0x03)
X
X
X
X 6.2.51 _s_e_t
X
X usage: set [$]i<name>=<int-expression>[, ...]
X set [$]s<name>=<str-expression>[, ...]
X
X
X
X
X Copyright (C) 1989, Warren H. Tucker 10/8/89
X
X
X
X
X
X
X
X ECU Technical Description 53
X
X
X
X This command sets an integer or string variable to an expression. The
X 'set' verb may be omitted provided the otherwise optional '$' is
X supplied. There are many examples of how the set statement is performed
X throughout this document. The examples here are to further clarify the
X statement's syntax.
X
X If the '=<expression>' is omitted, the value of the variable is
X displayed (useful when debugging). If procedure tracing is enabled
X with the ppppttttrrrraaaacccceeee command, all variables referenced by the sssseeeetttt ccccoooommmmmmmmaaaannnndddd,,,,
X wwwwhhhheeeetttthhhheeeerrrr aaaa vvvvaaaalllluuuueeee iiiissss aaaassssssssiiiiggggnnnneeeedddd oooorrrr nnnnooootttt,,,, aaaarrrreeee ddddiiiissssppppllllaaaayyyyeeeedddd....
X
X
X Examples:
X
X set i0=0
X set $s0='brown',s1='The quick '+$s0+' fox'
X set $S0 with no '=', displays contents
X set i0,$i1,s0='abc',s1
X $s0 = 'abc' legal
X set s0='abc' legal
X s0 = 'abc' illegal
X
X 6666....2222....55552222 _s_k
X usage: sk [-a] <str>
X
X This command invokes the Kermit file transfer protocol to send one or
X more files. If switch '-a' is supplied, newlines are converted to
X carriage return/linefeed pairs. If '-a' is omitted, the file(s) are
X transmitted without modification.
X
X Integer variable $i0 receives the exit status from the transfer. Note:
X procedure execution is NOT terminated by a SIGINT to the spawned file
X transfer process. It is the responsibility of the procedure to process
X the exit status returned in $i0. If $i0 is set to -1, the file transfer
X program did not begin.
X
X
X 6.2.53 _s_s
X usage: ss <str>
X
X This command invokes the SEAlink file transfer protocol to send one or
X more files. There is no provision in the SEAlink protocol to convert
X newlines to carriage return/linefeed pairs. so the received files are
X stored as received.
X
X Integer variable $i0 receives the exit status from the transfer. Note:
X procedure execution is NOT terminated by a SIGINT to the spawned file
X transfer process. It is the responsibility of the procedure to process
X the exit status returned in $i0. If $i0 is set to -1, the file transfer
X program did not begin.
X
X
X
X
X Copyright (C) 1989, Warren H. Tucker 10/8/89
X
X
X
X
X
X
X
X ECU Technical Description 54
X
X
X
X 6.2.54 _s_x
X usage: sx [-ak[l]] [<label-str>] <filename-str>
X
X This command invokes the XMODEM or XMODEM-1K file transfer protocol to
X send a file. If '-k' is supplied, XMODEM-1K is used, else XMODEM. If
X switch '-a' is supplied, newlines are converted to carriage
X return/linefeed pairs. If '-a' is omitted, the file(s) are transmitted
X without modification. If '-l' is supplied, then <label-str> specifies a
X string to display on the bottom of the file transfer screen. If '-l' is
X omitted, then <label_str> must also be omitted.
X
X Integer variable $i0 receives the exit status from the transfer. Note:
X procedure execution is NOT terminated by a SIGINT to the spawned file
X transfer process. It is the responsibility of the procedure to process
X the exit status returned in $i0. If $i0 is set to -1, the file transfer
X program did not begin.
X
X
X Examples:
X
X sx -al 'sending log file' '/tmp/log.file'
X sx -
X
X
X
X 6.2.55 _s_y
X usage: sy [-a[l]] [<label-str>] <filelist-str>
X
X This command invokes the YMODEM Batch (not to be confused with XMODEM-
X 1K) file transfer protocol to send one or more files.
X
X If switch '-a' is supplied, newlines are converted to carriage
X return/linefeed pairs. If '-a' is omitted, the file(s) are transmitted
X without modification. If '-l' is supplied, then <label-str> specifies a
X string to display on the bottom of the file transfer screen. If '-l' is
X omitted, then <label_str> must also be omitted.
X
X Integer variable $i0 receives the exit status from the transfer. Note:
X procedure execution is NOT terminated by a SIGINT to the spawned file
X transfer process. It is the responsibility of the procedure to process
X the exit status returned in $i0. If $i0 is set to -1, the file transfer
X program did not begin.
X
X
X 6.2.56 _s_y_s_t_e_m
X usage: system [-l] <cmdstr>
X
X If switch '-l', is supplied, the attached communications line becomes
X the stdin and stdout for the command.
X
X Integer variable $i0 is set to the spawned process' exit status if the
X
X
X
X Copyright (C) 1989, Warren H. Tucker 10/8/89
X
X
X
X
X
X
X
X ECU Technical Description 55
X
X
X
X process exits "normally", or 0x100 if the process is killed, dumps core
X or interrupted.
X
X Note: procedure execution is NOT terminated by a SIGINT to the spawned
X process. It is the responsibility of the procedure to process the exit
X status returned in $i0. If $i0 is set to -1, the file transfer program
X did not begin.
X
X
X 6.2.57 _s_z
X usage: sz [-anf[l]] [<label-str>] <filelist-str>
X
X This command invokes the ZMODEM (CRC-32 capable) file transfer protocol
X to send one or more files.
X
X Switch '-n' causes the receiver to accept files with do not already
X exist at the remote system or which have older times of last access
X that at the sending system.
X
X Switch '-f' causes the full pathname of each file to be sent;
X otherwise, the simple filename is transmitted.
X
X If switch '-a' is supplied, newlines are converted to carriage
X return/linefeed pairs. If '-a' is omitted, the file(s) are transmitted
X without modification.
X
X If '-l' is supplied, then <label-str> specifies a string to display on
X the bottom of the file transfer screen. If '-l' is omitted, then
X <label_str> must also be omitted.
X
X Integer variable $i0 receives the exit status from the transfer. Note:
X procedure execution is NOT terminated by a SIGINT to the spawned file
X transfer process. It is the responsibility of the procedure to process
X the exit status returned in $i0. If $i0 is set to -1, the file transfer
X program did not begin.
X
X
X 6.2.58 _v_i_d_n_o_r_m
X usage: vidnorm
X
X This command causes later screen output to appear in the normal, as
X opposed to reverse video mode. The ccccoooolllloooorrrr command forces normal video
X mode.
X
X
X 6.2.59 _v_i_d_r_e_v
X usage: vidrev
X
X This command causes later screen output to appear in the reverse, as
X opposed to normal video mode. The ccccoooolllloooorrrr command forces normal video
X mode.
X
X
X
X Copyright (C) 1989, Warren H. Tucker 10/8/89
X
X
X
X
X
X
X
X ECU Technical Description 56
X
X
X
X 6.2.60 _w_h_i_l_e_i
X
X usage: whilei <int> <rel-op> <int> <statement>
X whilei <int> <rel-op> <int>
X <statement>
X whilei <int> <rel-op> <int>
X {
X any kind or number of statements
X }
X
X
X This command executes a loop one or more statements based on a test of
X two integer quantities. See the description of the bbbbrrrreeeeaaaakkkk, eeeellllsssseeee, wwwwhhhhiiiilllleeeeiiii,
X and wwwwhhhhiiiilllleeeessss commmands for examples of how the command is used.
X
X
X 6.2.61 _w_h_i_l_e_s
X
X usage: whiles <str> <rel-op> <str> <statement>
X whiles <int> <rel-op> <int>
X <statement>
X whiles <int> <rel-op> <int>
X {
X any kind or number of statements
X }
X
X
X This command executes a loop of one or more statements based on a test
X of two string values. See the description of the bbbbrrrreeeeaaaakkkk, ccccoooonnnnttttiiiinnnnuuuueeee, and
X eeeellllsssseeee commmands and many other examples throughout the document, for
X examples of how the command is used.
X
X
X
X 6.3 _I_n_t_e_g_e_r _F_u_n_c_t_i_o_n_s
X
X
X
X 6.3.1 %_a_r_g_c
X
X This function returns the number of arguments passes to the current
X procedure.
X
X
X
X
X 6.3.2 %_b_a_u_d
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
X
X
X Copyright (C) 1989, Warren H. Tucker 10/8/89
X
X
X
X
X
X
X
X ECU Technical Description 57
X
X
X
X session, the default baud rate is returned.
X
X
X 6.3.3 %_c_o_l_o_r_s
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 AAAAllllpppphhhhaaaaeeeettttiiiicccc OOOOrrrrddddeeeerrrr
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
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X Copyright (C) 1989, Warren H. Tucker 10/8/89
X
X
X
X
X
X
X
X ECU Technical Description 58
X
X
X
X NNNNuuuummmmeeeerrrriiiicccc OOOOrrrrddddeeeerrrr
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 6.3.4 %_c_o_n_n
X
X This function returns 1 if a connection is in progress, else 0. NOTE:
X if carrier is lost abnormally, %conn will return 1 incorrectly.
X
X
X 6.3.5 %_c_s_e_c
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 6.3.6 %_c_t_o_i
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 6.3.7 %_f_a_t_i_m_e
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 ffffooooppppeeeennnn command. If the argument is a
X string, it is the literal filename.
X
X
X
X Copyright (C) 1989, Warren H. Tucker 10/8/89
X
X
X
X
X
X
X
X ECU Technical Description 59
X
X
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 %%%%eeeeddddaaaatttteeee 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 6.3.8 %_f_m_o_d_e
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 ffffooooppppeeeennnn
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 6.3.9 %_f_m_t_i_m_e
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 ffffooooppppeeeennnn 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 %%%%eeeeddddaaaatttteeee 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 6.3.10 %_f_m_o_d_e
X
X usage: %fmode(int0)
X %fmode(str0)
X
X
X This function returns the size of the file referenced by the argument.
X
X
X
X Copyright (C) 1989, Warren H. Tucker 10/8/89
X
X
X
X
X
X
X
X ECU Technical Description 60
X
X
X
X If the argument is an integer, the file referenced is the file opened by
X that number with the ffffooooppppeeeennnn 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 error. If the file specified by str0 does not exist, -1 is returned.
X
X
X 6.3.11 %_f_t_e_l_l
X
X usage: ftell(int0)
X
X This function returns the current file position of the the file opened
X by int0 with the ffffooooppppeeeennnn command.
X
X If int0 does not refer to an open file, the procedure terminates with an
X error.
X
X
X 6.3.12 %_i_n_s_t_r
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.
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 6.3.13 %_i_s_c_h_r
X
X
X
X
X
X Copyright (C) 1989, Warren H. Tucker 10/8/89
X
X
X
X
X
X
X
X ECU Technical Description 61
X
X
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 referenced is the file opened by that number with the ffffooooppppeeeennnn 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 6.3.14 %_i_s_d_i_r
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 ffffooooppppeeeennnn 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 6.3.15 %_i_s_r_e_g
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
X
X
X Copyright (C) 1989, Warren H. Tucker 10/8/89
X
X
X
X
X
X
X
X ECU Technical Description 62
X
X
X
X regular file, else 0. If the argument is an integer, the file
X referenced is the file opened by that number with the ffffooooppppeeeennnn 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 %isreg('/dev/tty') returns 0
X %isreg('/usr/bin') returns 0
X %isreg('/xenix') returns 1
X
X
X
X 6.3.16 %_l_e_n
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 6.3.17 %_l_g_e_t_c
X
X Returns a character read from the line.
X
X
X 6.3.18 %_p_i_d
X
X This function returns the process id (pid) of ECU.
X
X
X 6.3.19 %_m_a_t_c_h
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
X
X
X Copyright (C) 1989, Warren H. Tucker 10/8/89
X
X
X
X
X
X
X
X ECU Technical Description 63
X
X
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 6.3.20 %_r_c_h_r
X
X This function returns the number of characters received by ECU since the
X program starrted.
X
X
X 6.3.21 %_r_c_h_r_c
X
X This function returns the number of characters received by ECU during
X the current connection.
X
X
X 6.3.22 %_s_t_o_i
SHAR_EOF
echo "End of part 44"
echo "File doc/ecu.man is continued in part 45"
echo "45" > s2_seq_.tmp
exit 0
--
-------------------------------------------------------------------
Warren Tucker, Tridom Corporation ...!gatech!emory!tridom!wht
Ker-au'-lo-phon. An 8-foot partial flue-stop, having metal pipes
surmounted by adjustable rings, and with a hole bored near the top
of each pipe, producing a soft and "reedy" tone.
More information about the Alt.sources
mailing list