[alt.sources] ecu - SCO XENIX V/{2,3}86 Extended CU part 39/47

wht@tridom.uucp (Warren Tucker) (10/12/89)

---- Cut Here and unpack ----
#!/bin/sh
# this is part 39 of a multipart archive
# do not concatenate these parts, unpack them in order with /bin/sh
# file doc/_p_cmd.txt continued
#
CurArch=39
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/_p_cmd.txt"
sed 's/^X//' << 'SHAR_EOF' >> doc/_p_cmd.txt
Xenabled with the
X.B ptrace
Xcommand, all variables referenced by the
X.B
Xset
Xcommand, whether a value is assigned or not, are displayed.
X
X.DS L
XExamples:
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.DE
X.*s 3 "sk"
Xusage: sk [-a] <str>
X
XThis command invokes the Kermit file transfer protocol to send
Xone or more files.
XIf switch '-a' is supplied,
Xnewlines are converted to carriage return/linefeed pairs.
XIf '-a' is omitted, the file(s) are transmitted without modification.
X
XInteger variable $i0 receives the exit status from the transfer.  Note:
Xprocedure execution is NOT terminated by a SIGINT to the spawned file
Xtransfer process.  It is the responsibility of the procedure to process
Xthe exit status returned in $i0.
XIf $i0 is set to -1, the file transfer program did not begin.
X
X.*s 3 "ss"
Xusage: ss <str>
X
XThis command invokes the SEAlink file transfer protocol to send
Xone or more files.
XThere is no provision in the SEAlink protocol to convert
Xnewlines to carriage return/linefeed pairs.
Xso the received files are stored as received.
X
XInteger variable $i0 receives the exit status from the transfer.  Note:
Xprocedure execution is NOT terminated by a SIGINT to the spawned file
Xtransfer process.  It is the responsibility of the procedure to process
Xthe exit status returned in $i0.
XIf $i0 is set to -1, the file transfer program did not begin.
X
X.*s 3 "sx"
Xusage: sx [-ak[l]] [<label-str>] <filename-str>
X
XThis command invokes the XMODEM or XMODEM-1K file transfer protocol
Xto send a file.  If '-k' is supplied, XMODEM-1K is used, else XMODEM.
XIf switch '-a' is supplied,
Xnewlines are converted to carriage return/linefeed pairs.
XIf '-a' is omitted, the file(s) are transmitted without modification.
XIf '-l' is supplied, then <label-str> specifies a string to
Xdisplay on the bottom of the file transfer screen.  If '-l' is
Xomitted, then <label_str> must also be omitted.
X
XInteger variable $i0 receives the exit status from the transfer.  Note:
Xprocedure execution is NOT terminated by a SIGINT to the spawned file
Xtransfer process.  It is the responsibility of the procedure to process
Xthe exit status returned in $i0.
XIf $i0 is set to -1, the file transfer program did not begin.
X
X.DS L
XExamples:
X
X    sx -al 'sending log file' '/tmp/log.file'
X    sx -
X.DE
X
X.*s 3 "sy"
Xusage: sy [-a[l]] [<label-str>] <filelist-str>
X
XThis command invokes the YMODEM Batch (not 
Xto be confused with XMODEM-1K) file transfer protocol
Xto send one or more files. 
X
XIf switch '-a' is supplied,
Xnewlines are converted to carriage return/linefeed pairs.
XIf '-a' is omitted, the file(s) are transmitted without modification.
XIf '-l' is supplied, then <label-str> specifies a string to
Xdisplay on the bottom of the file transfer screen.  If '-l' is
Xomitted, then <label_str> must also be omitted.
X
XInteger variable $i0 receives the exit status from the transfer.  Note:
Xprocedure execution is NOT terminated by a SIGINT to the spawned file
Xtransfer process.  It is the responsibility of the procedure to process
Xthe exit status returned in $i0.
XIf $i0 is set to -1, the file transfer program did not begin.
X
X.*s 3 "system"
Xusage: system [-l] <cmdstr>
X
XIf switch '-l', is supplied, the attached communications line 
Xbecomes the stdin and stdout for the command.
X
XInteger variable $i0 is set to
Xthe spawned process' exit status if the process exits "normally",
Xor 0x100 if the process is killed, dumps core or interrupted.
X
XNote:  procedure execution is NOT terminated by a SIGINT to
Xthe spawned process.  It is the responsibility of the procedure
Xto process the exit status returned in $i0.
XIf $i0 is set to -1, the file transfer program did not begin.
X
X.*s 3 "sz"
Xusage: sz [-anf[l]] [<label-str>] <filelist-str>
X
XThis command invokes the ZMODEM (CRC-32 capable)
Xfile transfer protocol to send one or more files. 
X
XSwitch '-n' causes the receiver to accept files with do not
Xalready exist at the remote system or which have older
Xtimes of  last access that at the sending system.
X
XSwitch '-f'  causes the full pathname of each file to be sent;
Xotherwise, the simple filename is transmitted.
X
XIf switch '-a' is supplied,
Xnewlines are converted to carriage return/linefeed pairs.
XIf '-a' is omitted, the file(s) are transmitted without modification.
X
XIf '-l' is supplied, then <label-str> specifies a string to
Xdisplay on the bottom of the file transfer screen.  If '-l' is
Xomitted, then <label_str> must also be omitted.
X
XInteger variable $i0 receives the exit status from the transfer.  Note:
Xprocedure execution is NOT terminated by a SIGINT to the spawned file
Xtransfer process.  It is the responsibility of the procedure to process
Xthe exit status returned in $i0.
XIf $i0 is set to -1, the file transfer program did not begin.
X
X.*s 3 "vidnorm"
Xusage: vidnorm
X
XThis command causes later screen output to appear in the
Xnormal, as opposed to reverse video mode.
XThe
X.B color
Xcommand forces normal video mode.
X
X.*s 3 "vidrev"
Xusage: vidrev
X
XThis command causes later screen output to appear in the
Xreverse, as opposed to normal video mode.
XThe
X.B color
Xcommand forces normal video mode.
X
X.*s 3 "whilei"
X.DS L
Xusage: 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.DE
X
XThis command executes a loop one or more statements
Xbased on a test of two integer quantities.  See the
Xdescription of the
X.B break ,
X.B else ,
X.B whilei ,
Xand
X.B whiles
Xcommmands for examples of how the command is used.
X
X.*s 3 "whiles"
X.DS L
Xusage: 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.DE
X
XThis command executes a loop of one or more statements
Xbased on a test of two string values.  See the
Xdescription of the
X.B break ,
X.B continue ,
Xand
X.B else
Xcommmands
Xand many other examples throughout the document,
Xfor examples of how the command is used.
X
SHAR_EOF
echo "File doc/_p_cmd.txt is complete"
chmod 0644 doc/_p_cmd.txt || echo "restore of doc/_p_cmd.txt fails"
echo "x - extracting doc/_p_ifunc.txt (Text)"
sed 's/^X//' << 'SHAR_EOF' > doc/_p_ifunc.txt &&
X.*s 2 "Integer Functions"
X
X.*s 3 "%argc"
X
XThis function returns the number of arguments passes to the current
Xprocedure.
X
X
X
X.*s 3 "%baud"
X
XThis function returns the baud rate of the communications line.
XIf no line is currently attached, the baud rate returned
Xis the value of the last line attached.  If no line has been attached
Xduring the current session, the default baud rate is returned.
X
X.*s 3 "%colors"
X
XThis function returns the state of the normal and reverse video
Xforeground and background colors in the 32-bit value:
X.DS I
X00000000001111111111222222222233
X01234567890123456789012345678901
X0000|--|0000|--|0000|--|0000|--|
X     fg      bk      fg      bk
X      reverse          normal
X.DE
X
XThe color values are obtained from the following lists:
X.DS L
X.B
X    Alphaetic Order
X.R
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.DE
X
X.DS L
X.B
X    Numeric Order
X.R
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.DE
X
X.*s 3 "%conn"
X
XThis function returns 1 if a connection is in progress, else 0.
XNOTE:  if carrier is lost abnormally, %conn will return 1
Xincorrectly.
X
X.*s 3 "%csec"
X
XThis function returns the number of seconds ECU has been
Xconnected to a remote system.  If ECU is not connected,
Xzero is returned.
X
X.*s 3 "%ctoi"
X
Xusage: %ctoi(str0)
X
XThis function returns the integer value of the first
Xcharacter in string str0.  If str0 is non-empty, the return value
Xwill be between 0 and 255, inclusive.  if str0 is empty,
Xthen -1 is returned.
X
X.*s 3 "%fatime"
X.DS L
Xusage: %fatime(int0)
X       %fatime(str0)
X.DE
X
XThis function returns the time of last access of the file referenced
Xby the argument.
XIf the argument is an integer, the file referenced is the file
Xopened by that number with the
X.B fopen
Xcommand.
XIf the argument is a string, it is the literal filename.
X
XIf int0 does not refer to an open file, the procedure
Xterminates with an error.
XIf the file specified by str0 does not exist, -1 is returned.
X
XThe return value is the number of seconds since January 1, 1970
Xat 0000 UTC.
XThe
X.B %edate
Xstring function may be used to convert the integer
Xvalue to a string representation of the date and time
Xexpressed relative to the current time zone.
X
X.*s 3 "%fmode"
X.DS L
Xusage: %fmode(int0)
X       %fmode(str0)
X.DE
X
XThis function returns the file mode value ("rwxrwx---" == 077)
Xof the file referenced
Xby the argument.
XIf the argument is an integer, the file referenced is the file
Xopened by that number with the
X.B fopen
Xcommand.
XIf the argument is a string, it is the literal filename.
X
XIf int0 does not refer to an open file, the procedure
Xterminates with an error.
XIf the file specified by str0 does not exist, -1 is returned.
X
X.*s 3 "%fmtime"
X.DS L
Xusage: %fmtime(int0)
X       %fmtime(str0)
X.DE
X
XThis function returns the time of last modified of the file referenced
Xby the argument.
XIf the argument is an integer, the file referenced is the file
Xopened by that number with the
X.B fopen
Xcommand.
XIf the argument is a string, it is the literal filename.
X
XIf int0 does not refer to an open file, the procedure
Xterminates with an error.
XIf the file specified by str0 does not exist, -1 is returned.
X
XThe return value is the number of seconds since January 1, 1970
Xat 0000 UTC.
XThe
X.B %edate
Xstring function may be used to convert the integer
Xvalue to a string representation of the date and time
Xexpressed relative to the current time zone.
X
X.*s 3 "%fmode"
X.DS L
Xusage: %fmode(int0)
X       %fmode(str0)
X.DE
X
XThis function returns the size
Xof the file referenced
Xby the argument.
XIf the argument is an integer, the file referenced is the file
Xopened by that number with the
X.B fopen
Xcommand.
XIf the argument is a string, it is the literal filename.
X
XIf int0 does not refer to an open file, the procedure
Xterminates with an error.
XIf the file specified by str0 does not exist, -1 is returned.
X
X.*s 3 "%ftell"
X
Xusage: ftell(int0)
X
XThis function returns the current file position
Xof the the file
Xopened by int0 with the
X.B fopen
Xcommand.
X
XIf int0 does not refer to an open file, the procedure
Xterminates with an error.
X
X.*s 3 "%instr"
X
Xusage: %instr(str0,str1)
X
XThis function returns the leftmost column position withing str0
Xthat str1 is found (zero relative).  If str1 cannot be found in
Xstring str0, -1 is returned.  However, if str1 is null and str0 is not,
Xzero will be returned (i.e., the null string matches at the left).
X
XThe comparison is made without regard to case.
X
X.DS I
XExamples:
X
X            00000000001111111
X            01234567890123456
XAssume $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.DE
X
X.*s 3 "%ischr"
X.DS L
Xusage: %ischr(int0)
X       %ischr(str0)
X.DE
X
XThis function returns 1 if the file referenced by the argument is a
Xcharacter special file,
Xelse 0.
XIf the argument is an integer, the file referenced is the file
Xopened by that number with the
X.B fopen
Xcommand.
XIf the argument is a string, it is the literal filename.
X
XIf int0 does not refer to an open file, the procedure
Xterminates with an error.
XIf the file specified by str0 does not exist, -1 is returned.
X
XExamples:
X
X.DS I
X%ischr('/dev/tty')    returns 1
X%ischr('/usr/bin')    returns 0
X%ischr('/xenix')      returns 0
X.DE
X
X.*s 3 "%isdir"
X.DS L
Xusage: %isdir(int0)
X       %isdir(str0)
X.DE
X
XThis function returns 1 if the file referenced by the argument is a
Xdirectory file,
Xelse 0.
XIf the argument is an integer, the file referenced is the file
Xopened by that number with the
X.B fopen
Xcommand.
XIf the argument is a string, it is the literal filename.
X
XIf int0 does not refer to an open file, the procedure
Xterminates with an error.
XIf the file specified by str0 does not exist, -1 is returned.
X
XExamples:
X
X.DS I
X%isdir('/dev/tty')    returns 0
X%isdir('/usr/bin')    returns 1
X%isdir('/xenix')      returns 0
X.DE
X
X.*s 3 "%isreg"
X.DS L
Xusage: %isreg(int0)
X       %isreg(str0)
X.DE
X
XThis function returns 1 if the file referenced by the argument is a
Xregular file,
Xelse 0.
XIf the argument is an integer, the file referenced is the file
Xopened by that number with the
X.B fopen
Xcommand.
XIf the argument is a string, it is the literal filename.
X
XIf int0 does not refer to an open file, the procedure
Xterminates with an error.
XIf the file specified by str0 does not exist, -1 is returned.
X
XExamples:
X
X.DS I
X%isreg('/dev/tty')    returns 0
X%isreg('/usr/bin')    returns 0
X%isreg('/xenix')      returns 1
X.DE
X
X.*s 3 "%len"
X
Xusage: %len(str0)
X
XThis function returns the length of str0.
X.DS I
XExample:
X
Xset str0='abcdef',i0=%len(str0),i1=%len('1234')
Xstr00 = 'abcdef'
Xint00 = 6
Xint01 = 4
X.DE
X
X.*s 3 "%lgetc"
X
XReturns a character read from the line.
X
X.*s 3 "%pid"
X
XThis function returns the process id (pid) of ECU.
X
X.*s 3 "%match"
X
Xusage: %match(str0,str1)
X
XThis function searches string str0 for a match with the regular
Xexpression in str1 (for information on regular expressions,
Xrefer to the ed(C) manual pages).
XThe function returns the index into str0 where the
Xmatch is found or -1 if no match can be found.
XThe matching process is case sensitive.
X
XThe variable $i0 receives the length of the matching
Xstring in str0 if a  match is found.  For this reason,
Xit is not advisable that $i0 otherwise be involved
Xin the operation.  Specifically to be avoided is:
X.DS I
Xset $i0=instr(...)
X.DE
X.DS I
XExamples:
X
X            00000000001111111
X            01234567890123456
XAssume $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.DE
X
X.*s 3 "%rchr"
X
XThis function returns the number of characters
Xreceived by ECU since the program starrted.
X
X.*s 3 "%rchrc"
X
XThis function returns the number of characters
Xreceived by ECU during the current connection.
X
X.*s 3 "%stoi"
X
Xusage: %stoi(str0)
X
XThis function converts the contents of str0 to an
Xinteger and returns  the value.
X
X.*s 3 "%xchr"
X
XThis function returns the number of characters
Xtransmitted by ECU since the program starrted.
X
X.*s 3 "%xchrc"
X
XThis function returns the number of characters
Xtransmitted by ECU during the current connection.
X
X
SHAR_EOF
chmod 0644 doc/_p_ifunc.txt || echo "restore of doc/_p_ifunc.txt fails"
echo "x - extracting doc/_p_param.txt (Text)"
sed 's/^X//' << 'SHAR_EOF' > doc/_p_param.txt &&
X.*s 2 "Arguments"
X
XThere are five types of arguments to procedure commands:
X.DS I
Xwitch
XAlphabetic Token
XInteger
XString
XRelational Operators
X.DE
XThis section describes the syntax and construction of each type in turn.
XThere are separate groups of valid of relational operators for integers
Xand strings; thus, they are described under the appropriate sections.
X
X.*s 3 "Switches"
X
XSwitch arguments begin with a hyphen (minus, '-').  The switch
Xargument must be the first argument after the command.  Only
Xone switch argument is allowed on the command line.  If
Xswitches '-a', '-b' and '-c', are available and '-a' and '-b'
Xare desired, '-ab' or '-ba' is entered.
X
X.*s 3 "Alphabetic Tokens"
X
XAlphabetic tokens, for lack of a better term, are non-integer,
Xnon-quoted terms used as arguments for certain commands, such as:
X.DS I
Xplog off
X.DE
XSuch argument types are fairly simple to understand and use; they are
Xdescribed here for completeness.
X
X.*s 3 "Integers"
X
XInteger values are 32-bit quantities ranging between -2147483647
Xand 2147483647.
X
XIn one case, an integer is used to store a 32-bit color mask as
Xdescribed by the
X.B color
Xcommand and the
X.B %colors
Xinteger function.
X
X.*s 4 "Constants"
X
XInteger constants are numeric strings, optionally with an initial
Xminus sign, the absolue value of which must be less than 2147483648.
X
X.*s 4 "Variables"
X
XThere are 50 numbered, permanent integer variables referenced by
Xthe terms '$i0' through '$i49'.  When ECU is started, the value of each
Xvariable is zero.  Variables retain their
Xvalue until changed, even between procedure executions.
XThe integer variable number may be expressed
Xas an expression by enclosing an integer expression in brackets.
XFor instance:
X.DS L
X     $i[4+5]      refers to $i9
X
X     $i2=5
X     $i[20+$i2]   refers to $i25
X.DE
X
XInteger variables may be created for use as "local" variables or
Xto promote code readability.  Refer to the
X.B mkvar
Xcommand.
X
X.*s 4 "Functions"
X
XECU has many built-in functions which return the value of ecu- or
Xsystem-related information.  A list of the functions appears in a
Xlater section.
X
X.*s 4 "Expressions"
X
XIn almost any place an integer argument is allowed, an expression
Xmay be supplied.  Expressions are composed of two or more integer
Xconstants or variables separated by operators from the group:
X.DS L
X    +     addition
X    -     subtraction
X    *     multiplication
X    /     division
X    |     OR
X    @     MOD
X    ^     XOR
X    &     AND
X.DE
XEvaluation of expressions is left-to-right.  Parentheses are
Xnot allowed.
X
X.*s 4 "Relational Operators"
X
XInteger relational operators are chosen from the following group:
X.DS L
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.DE
X
X.*s 3 "Strings"
X
XStrings are classic concatenations of zero or more eight-bit
Xcharacters.  In general, the maximum size of a string used by
XECU is 256 characters.
X
X.*s 4 "Constants"
X
XString constants are formed by placing alphanumeric characters
Xbetween single quote characters (apostrophes).  The backslash ('\\')
Xcharacter is used to "escape" certains characters:
X.DS L
X    '\\\\'    one backslash
X    '\\n'   newline
X    '\\t'   tab
X    '\\''   apostrophe
X.DE
X
X.*s 4 "Variables"
X
XThere are 50 numbered, permanent string variables referenced by
Xthe terms '$s0' through '$s49',
Xeach possessing a maximum length of 256 characters
XWhen ECU is started, the value of each
Xvariable is null (zero length).  Variables retain their
Xvalue until changed, even between procedure executions.
XThe string variable number may be expressed
Xas an expression by enclosing an string expression in brackets.
XFor instance:
X.DS L
X     $s[4+5]      refers to $s9
X
X     $s2=5
X     $s[20+$s2]   refers to $s25
X.DE
X
XString variables may be created for use as "local" variables or
Xto promote code readability.  Refer to the
X.B mkvar
Xcommand.
X
X.*s 4 "Functions"
X
XECU has many built-in functions which return the value of ecu- or
Xsystem-related information.  A list of the functions appears in a
Xlater section.
X
X.*s 4 "Expressions"
X
XString expressions are formed by the concatenation of string
Xconstants, variables and function return values using the '+'
Xoperator:
X.DS L
XExample:
X   'The quick brown fox jumped over the '+$s0'+' dog at '+%time
X.DE
X
X.*s 4 "Relational Operators"
X
XString relational operators are chosen from the following group:
X.DS L
X     =       "is equal to"
X     ==      "is equal to"
X     !=      "is not equal to"
X     <>      "is not equal to"
X.DE
X
SHAR_EOF
chmod 0644 doc/_p_param.txt || echo "restore of doc/_p_param.txt fails"
echo "x - extracting doc/_p_sfunc.txt (Text)"
sed 's/^X//' << 'SHAR_EOF' > doc/_p_sfunc.txt &&
X.*s 2 "String Functions"
X
X.*s 3 "%argv"
X
Xusage: %argv(int0)
X
XThis function returns the string value of an argument passed
Xto the procedure by the 'do' command.  Argument 0 is the
Xname of the procedure itself.
XThe integer function %argc may be used to determine the
Xnumber of arguments passed to the procedure.  Specifying
Xan argument number greater than the number of arguments
Xpassed returns a null string (if procedure tracing is enabled
Xwith the 'ptrace' comand, a warning will be displayed
Xin this case).
X.DS I
XExample:
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.DE
X
X.B NOTE:
Xthe interactive
X.B dial
Xcommand, the dialing directory menu and the initial setup menu
Xall can automatically execute a procedure which matches
Xa dialed
X.B
Xlogical telephone number.
X.R
XThere two arguments passed to these procedures, %argv(0) being
Xthe procedure name as always.  %argv(1) is set according to the following
Xtable:
X.DS I
X invoker              %argv(1)
X-------------------  -------------
Xinitial setup menu   !INITIAL
Xinteractive dial     !INTERACTIVE
Xdialing menu         !MENU
X.DE
XThus it is possible for the invoked procedure
Xto determine that it has been automatically executed
Xby testing %argv(1) for an exclamation point, or possibly
Xthe entire argument.
X
X.*s 3 "%cgetc"
X
Xusage: %cgetc
X
XThis  function reads one character from the console keyboard
Xand returns it.  The character is not echoed.
X
X.*s 3 "%cgets"
X
Xusage: %cgets
X
XThis function reads a string from the console keyboard
Xand returns it.  Each character is echoed as it is typed
Xand the user's normal erase and kill character is available
Xto edit the input before terminating the read with ENTER.
X
X.*s 3 "%chr"
X
Xusage: %chr(int0)
X
XThis function returns the character value whose ASCII value
Xis supplied in int0.
X
X.DS L
XExample:
X
X    set $s0 = %chr(4)  places a ^D (EOT) character into $s0
X.DE
X
X.*s 3 "%date"
X
Xusage: %date
X
XThis function returns the current date in the form 'mm-dd-yyyy'.
X
X.*s 3 "%day"
X
Xusage: %day
X
XThis function returns the current day of the week as a three character
Xabbreviation: 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'.
X
X.*s 3 "%dir"
X
Xusage: %dir
X
XThis function returns the
Xfull pathname of the current working directory.
X
X.*s 3 "%edate"
X
Xusage: %edate(int0)
X
XThe value in int0 is expected to be a number of seconds since January 1,
X1970 00:00 UTC (Universal Coordinated Time) as returned by
Xthe integer functions %fatime and %fmtime.
XThis function converts the value into a string representing the
Xequivalent local time in the form 'mm-dd-yyyy hh:mm:ss'.
X.DS L
XExample:
X
Xset $i0=%fmtime('/xenix')
X$i00 = 601178971 (0x23d5435b,04365241533)
X
Xset $s0=%edate($i0)
X$s00 = '01-18-1989 21:09:31'
X.DE
X
X.*s 3 "%envvar"
X
Xusage: %envvar()
X
XThis function returns the string value of an environment
Xvariable.
X
X.DS L
XExample:
X
X    set $s0=%envvar('HOME') might set $s0 '/usr/user'
X.DE
X.DF L
XTypical 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.DE
X
X.*s 3 "%errstr"
X
Xusage: %errstr(int0)
X
XThis function returns the system error message, given int0 as an
X.B errno
Xas returned by a file-related command.
X.B fopen.
X
X.DS L
XExample:
X
X    echo %errstr(1)
X    Not owner
X.DE
X
X.*s 3 "%etime"
X
Xusage: %etime(int0)
X
XThis function returns a string representation of elapsed time
Xin the format 'hh:mm:ss'
Xfor the integer parameter int0, a number of seconds.
X
X.DS L
XExample:
X
X    echo %etime(62)
X    00:01:02
X.DE
X
X.*s 3 "%fmodestr"
X
Xusage: %fmodestr(int0)
X
XThis function returns a string representation of the
Xfamiliar file mode string given the file mode integer int0.
X
X.DS L
XExample:
X
X    echo %fmodestr(0100755)
X    -rwxr-xr-x
X
X    echo %fmodestr(%fmode('/usr/lib'))
X    drwxr-xr-x
X.DE
X
X.*s 3 "%itos"
X
Xusage: %itos(int0[,format])
X
XThis function converts integer int0 to a string, optionally
Xcontrolling the format of the conversion.
X
XIf the format parameter is missing, the conversion is to
Xa minimum number of decimal characters necessary to
Xhold the result.
X
XIf the format parameter is present, it must of consist of
Xa non-null string made of one or both optional parts:
X.DS L
X    decimal number of digits to be part of result string
X    (a leading zero indicates leading zeroes are to
X    appear in the string; no leading zero pads with
X    leading spaces
X
X    a lower case letter from the following list:
X        d - decimal conversion
X        x - hexadecimal conversion
X        o - octal conversion
X.DE
X.DS L
XExample:
X
X    %itos(33)           '33'
X    %itos(33,d)         '33'
X    %itos(33,x)         '21'
X    %itos(33,5d)        '   33'
X    %itos(33,010d)      '0000000033'
X    %itos(33,10d)       '        33'
X    %itos(33,x)         '21'
X    %itos(33,04x)       '0021'
X    %itos(33,4x)        '  21'
X    %itos(33,o)         '41'
X    %itos(33,4o)        '    41'
X.DE
X
X.*s 3 "%left"
X
Xusage: %left(str0,int0)
X
XThis function returns the leftmost int0 characters of str0.
XIf the length of the string is less than int0,
Xthe entire str0 is returned.
X.DS L
XExample:
X
X    if $s0 == 'abcdefg'
X    %left($s0,3) returns 'abc'
X.DE
X
X.*s 3 "%line"
X
Xusage: %line
X
XThis function returns the name of the attached communications
Xline in the form "/dev/ttyxx".  If no line is currently
Xattached, the function returns null.
X
X.*s 3 "%logname"
X
Xusage: %logname
X
XThis function returns the login name of the user executing
XECU.  Note: the name returned is the name supplied to a login
Xprompt, not any current su(C) username that may be in effect.
X
X.*s 3 "%mid"
X
Xusage: %mid(str0,int0[,int1])
X
XThis function returns the middle portion of a string str0
Xbeginning with the character at position int0 and for a length
Xof int1 characters.
XIf int0 is greater than or equal to the length of
Xstro, a null string is returned.
XIf the optional argument int1 is not supplied, or
Xif the length of the string is less than int1,
Xthe entire str0 is returned.
X.DS L
XExample:
X
X    if $s0 == '0123456789abc'
X    %mid($s0,3,4)  returns '3456'
X    %mid($s0,3)    returns '3456789abc'
X    %mid($s0,10,2) returns 'ab'
X    %mid($s0,10,5) returns 'abc'
X.DE
X
X.*s 3 "%month"
X
Xusage: %month
X
XThis function returns the current month as a three character
Xabbreviation: 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'.
X
X.*s 3 "%rdesc"
X
Xusage: %rdesc
X
XThis function returns the
Xdescription
Xportion of the
Xdialing directory entry for the currently connected remote.
XIf no connection exists, the function returns null.
X
X.*s 3 "%right"
X
Xusage: %right(str0,int0)
X
XThis function returns the rightmost int0 characters of str0.
XIf the length of the string is less than int0,
Xthe entire str0 is returned.
X.DS L
XExample:
X
X    if $s0 == 'abcdefg'
X    %right($s0,3) returns 'efg'
X.DE
X
X.*s 3 "%rname"
X
Xusage: %rname
X
XThis function returns the
Xlogical name
Xportion of the
Xdialing directory entry for the currently connected remote.
XIf no connection exists, the function returns null.
X
X.*s 3 "%rtelno"
X
Xusage: %rtelno
X
XThis function returns the
Xtelephone number
Xportion of the
Xdialing directory entry for the currently connected remote.
SHAR_EOF
echo "End of part 39"
echo "File doc/_p_sfunc.txt is continued in part 40"
echo "40" > 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.