home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-05-11 | 54.1 KB | 2,063 lines |
- Newsgroups: comp.sources.misc
- subject: v12i081: ECU 2.80 part 28/29
- from: wht%n4hgf@gatech.edu (Warren Tucker)
- Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
-
- Posting-number: Volume 12, Issue 81
- Submitted-by: wht%n4hgf@gatech.edu (Warren Tucker)
- Archive-name: ecu2.80/part28
-
- ---- Cut Here and unpack ----
- #!/bin/sh
- # This is part 28 of ecu280
- if touch 2>&1 | fgrep '[-amc]' > /dev/null
- then TOUCH=touch
- else TOUCH=true
- fi
- # ============= doc/_p_param.txt ==============
- 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
- XSwitch
- 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
- $TOUCH -am 0414232090 doc/_p_param.txt &&
- chmod 0644 doc/_p_param.txt ||
- echo "restore of doc/_p_param.txt failed"
- set `wc -c doc/_p_param.txt`;Wc_c=$1
- if test "$Wc_c" != "4645"; then
- echo original size 4645, current size $Wc_c
- fi
- # ============= doc/_p_sfunc.txt ==============
- 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'
- Xin the local time zone (daylight time if it applies).
- X
- X.*s 3 "%datez"
- X
- Xusage: %datez
- X
- XThis function returns the current date in the form 'mm-dd-yyyy'
- Xin the UTC (Z) time zone.
- 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'
- Xin the local time zone (daylight time if it applies).
- X
- X.*s 3 "%dayz"
- X
- Xusage: %dayz
- X
- XThis function returns the current day of the week as a three character
- Xabbreviation: 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'
- Xin the UTC (Z) time zone.
- 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 the remote was dialed directly, as in dial 5551212, the
- Xreturned value is the phone number.
- XIf no connection exists, the function returns null.
- X
- XThe value returned by this command may be overridden by use of the
- X.B rname
- Xprocedure command.
- X
- X.*s 3 "%rtelno"
- Xusage: %rtelno
- X
- XThis function returns the
- Xtelephone number
- Xportion of the
- Xdialing directory entry for the currently connected remote.
- XIf no connection exists, the function returns null.
- X
- X.*s 3 "%time"
- X
- Xusage: %time
- X
- XThis function returns the current time in the form 'hh:mm'
- Xin the local time zone (daylight time if it applies).
- X
- X.*s 3 "%times"
- X
- Xusage: %times
- X
- XThis function returns the current time in the form 'hh:mm:ss'
- Xin the local time zone (daylight time if it applies).
- X
- X.*s 3 "%timez"
- X
- Xusage: %timez
- X
- XThis function returns the current time in the form 'hh:mm'
- Xin the UTC (Z) time zone.
- X
- X.*s 3 "%timezs"
- X
- Xusage: %timezs
- X
- XThis function returns the current time in the form 'hh:mm:ss'
- Xin the UTC (Z) time zone.
- X
- X.*s 3 "%tty"
- X
- Xusage: %tty
- X
- XThis function returns the console tty name in the form "/dev/ttynn".
- X
- SHAR_EOF
- $TOUCH -am 0405140790 doc/_p_sfunc.txt &&
- chmod 0644 doc/_p_sfunc.txt ||
- echo "restore of doc/_p_sfunc.txt failed"
- set `wc -c doc/_p_sfunc.txt`;Wc_c=$1
- if test "$Wc_c" != "8864"; then
- echo original size 8864, current size $Wc_c
- fi
- # ============= doc/_proc.txt ==============
- echo "x - extracting doc/_proc.txt (Text)"
- sed 's/^X//' << 'SHAR_EOF' > doc/_proc.txt &&
- X.*s 1 "Procedure Language"
- X
- XSample procedures are shown in the companion document 'samplproc.man'.
- X
- X
- X.so _p_param.txt
- X
- X.so _p_cmd.txt
- X
- X.so _p_ifunc.txt
- X
- X.so _p_sfunc.txt
- X
- SHAR_EOF
- $TOUCH -am 0711174289 doc/_proc.txt &&
- chmod 0644 doc/_proc.txt ||
- echo "restore of doc/_proc.txt failed"
- set `wc -c doc/_proc.txt`;Wc_c=$1
- if test "$Wc_c" != "171"; then
- echo original size 171, current size $Wc_c
- fi
- # ============= doc/_startup.txt ==============
- echo "x - extracting doc/_startup.txt (Text)"
- sed 's/^X//' << 'SHAR_EOF' > doc/_startup.txt &&
- X.*s 1 "Starting the Program"
- X
- X.*s 2 "Simple Startup - Initial Setup Menu"
- X
- XECU may be started in a number of ways through use of
- Xcommand line switches, but the easiest is to enter
- X.DS I
- Xecu
- X.DE
- Xby itself.
- XIn this case, the screen is cleared
- Xand the folowing screen will be presented.
- X
- X
- X.DS L
- X
- X .--[ ecu 1.96 Copyright 1986,1989, W. Tucker ]-----------------.
- X | |
- X | Name/phone number to call: ___________________ |
- X | |
- X | |
- X | tty: /dev/tty1a |
- X | |
- X | duplex: F baud: 2400 parity:N (data bits 8) |
- X | Add NL to transmitted CR: N |
- X | Add NL to received CR: N |
- X | |
- X | |
- X | TAB:next ^B:prev END:proceed ^D:phone dir ESC:quit ecu |
- X `- logical phone directory entry, phone number or empty -------'
- X
- X
- X.DE
- X
- X.*s 3 "Name/Phone Number Field"
- X
- XIf a dialing directory has been configured,
- Xa literal phone number need not be entered.
- XHowever, on your first invocation, you'll very likely have
- Xno directory. Therefore, you have three options:
- X
- X.DS I
- X1. Enter a literal telephone number, (e.g. 18005551212).
- X Hyphens and open and close parentheses may also
- X be entered.
- X
- X2. Press ENTER to skip the 'Name/phone' field and enter
- X ^D to enter the telephone directory to enter your
- X first directory entry.
- X
- X3. Press END to enter interactive mode and use the Dial
- X interactive command to dial a literal telephone num-
- X ber or to enter the dialing directory.
- X.DE
- X
- X.*s 3 "Other Fields"
- X
- XThe 'tty' field may be used to select an
- Xoutgoing line
- Xother than the default
- X/dev/tty1a.
- XNote: only the last two characters of the tty name
- Xneed be entered. The remainder of the tty name
- Xis assumed to be '/dev/tty'.
- X
- XThe 'duplex' field may be used to select a
- Xduplex value other than the default 'F' (full).
- X
- XThe 'baud' field may be used to select a
- Xbaud rate value other than the default 2400.
- X
- XThe 'parity' field may be used to select a
- Xparity value other than the default 'N' (none).
- X
- X
- XThe 'Add NL to transmitted CR' and 'Add NL to received CR'
- Xfields are usually left defaulted to 'N' (no). If you
- Xwill be communicating with a terminal (with a human), you
- Xwill usually need to set both of these fields to 'Y' as
- Xwell as to select 'H'alf duplex.
- X
- X.*s 3 "Special Characters"
- X
- XSpecial keyboard characters while filling in the
- Xstartup screen are:
- X
- X
- X.DS I
- X TAB move to next field ... if nothing typed in
- X the field, do not disturb contents
- X
- X ^B back up to previous field
- X
- X END proceed with session, dialing remote if
- X logical directory entry name or literal
- X telephone number enetered
- X
- X ^D enter phone directory
- X
- X ESC quit ecu without any communications
- X.DE
- X
- X.*s 2 "Command Line Arguments and Switches"
- X
- XECU can be started in a number of ways:
- X
- X.DS I
- Xecu [-lxx] [-b<baud>] [-h] [-e|-o] [-t] <tel-number>
- Xecu [-lxx] [-b<baud>] [-h] [-e|-o] [-t]
- Xecu [-t] <logical>
- Xecu [-lxx] [-b<baud>] [-h] [-e|-o] [-d] -p <proc> [<arg> ...]
- X.DE
- X
- X.*s 3 "-l"
- X
- XWhen ECU starts up, it normally chooses a line as described later
- Xin the section titled "Choosing a Dialout Line".
- XSpecifying the -l switch can suggest that the program
- Xchoose a specific line. The argument to the switch is the
- Xlast two charcters of the ttyname; e.g., "-l1a".
- X
- XOn a system with HoneyDanBerr UUCP,
- Xto access a device which does not appear in the Devices file,
- Xit may be necessary to explicitly specify the device with -l.
- X
- X.*s 3 "-f"
- XNormally, ECU starts up in the full duplex mode.
- XIf half duplex is desired, the
- X.B
- X-f switch
- X.R
- Xis used.
- X
- X.*s 3 "-e, -o"
- X
- XNormally, ECU starts up with 8 data bits and no parity.
- XIf even parity is desired, the
- X.B
- X-e switch
- X.R
- Xis specified.
- XIf odd parity is desired, the
- X.B
- X-o switch
- X.R
- Xis specified.
- X
- XThese switches
- X
- X.*s 3 "-p <procname>"
- X
- XThe
- X.B
- X-p switch
- X.R
- Xcauses ECU to execute the procedure <procname> ("<procname>.ep")
- Ximmediately. Such a procedure is termed the
- X.B
- Xinitial procedure.
- X.R
- XAll non-switch arguments after <procname> are passed as arguments
- Xto the initial procedure (see the descriptions of the
- Xinteger function
- X.B %argc
- Xand the string function
- X.B %argv ).
- X
- X.*s 3 "-d"
- X
- XThe
- X.B
- X-d switch
- X.R
- Xinstructs ECU to "die" (terminate with error status) if
- Xany specified initial procedure fails. This switch ensures a batch
- XECU execution will hang up any connection and terminate if
- Xa procedure error occurs.
- X
- XAbsence of the
- X.B
- X-d switch
- X.R
- Xcauses ecu (upon any completion of the
- Xinitial procedure) to enter the 1) interactive mode if a line
- Xwas successfully attached by the procedure or 2) the setup menu
- Xif not line was attached.
- X
- X.*s 3 "-t"
- X
- XThe
- X.B
- X-t switch
- X.R
- Xinstructs ECU to map incoming and outgoing carriage
- Xreturns to carriage return/line feed pairs.
- XThis is helpful if the remote connection will be to a
- Xterminal with a human operator. Use of the
- X.B
- X-h switch
- X.R
- Xis probably also necessary.
- X
- X.*s 2 "Environment Variables"
- X
- XPrior to starting ECU, it is useful, but not necessary,
- Xto establish two environment variables, ECUPROMPT and ECUHELP.
- X
- X.*s 3 "ECUPROMPT"
- X
- XThe ECUPROMPT environment variable determines the prompt printed
- Xby ECU when the interactive command key ("HOME") is pressed.
- XWhen you first run ECU, try setting it to your name, e. g.,
- X.DS I
- Xsetenv ECUPROMPT Ralph if you use csh
- X
- XECUPROMPT=Ralph if you use sh, ksh, etc.
- Xexport ECUPROMPT
- X.DE
- XThen, when you see how it used, you may wish to
- Xestablish a more permanent choice in your .login or .profile.
- X
- X.*s 3 "ECUHELP"
- X
- XOrdinarily, ECU looks for interactive command help information
- Xin "/usr/lib/ecu/ecuhelp.data".
- XThe ECUHELP environment may be set to the complete
- Xpathname of the ecu help file if an alternate file
- Xis to be used.
- X
- XThe help file is explained later in the section
- Xtitled "Online Command Dictionary".
- X
- SHAR_EOF
- $TOUCH -am 0414232490 doc/_startup.txt &&
- chmod 0644 doc/_startup.txt ||
- echo "restore of doc/_startup.txt failed"
- set `wc -c doc/_startup.txt`;Wc_c=$1
- if test "$Wc_c" != "6175"; then
- echo original size 6175, current size $Wc_c
- fi
- # ============= doc/_tech.txt ==============
- echo "x - extracting doc/_tech.txt (Text)"
- sed 's/^X//' << 'SHAR_EOF' > doc/_tech.txt &&
- X.*s 1 "Technical Notes"
- X
- XECU is written in Microsoft/SCO XENIX System V C. Full use
- Xis made of function prototyping for ECU functions and external
- Xlibrary functions. The source consists of 32,000 lines of source
- Xfiles (731000 bytes) and 2500 lines of header files (73000 bytes).
- XThe output of "size" for a -M3 version (actaul information may be
- Xobsolete):
- X
- X.DS I
- Xtext data bss dec hex
- X140940 + 34068 + 61852 = 236860 = 0x39d3c
- X.DE
- X
- X.*s 1 "Revision Numbers"
- X.DS L
- XECU revision numbers are defined as follows:
- X
- X pppp#.##-#86x
- X ^ ^ ^ ^ ^
- X | | | | `----- 's' if XENIX select(S) in use, 'n' if not
- X | | | `-------- '2' for 286, '3' for 386
- X | | `----------- patch level
- X | `------------- major revision
- X `---------------- package ('unet' for this release)
- X
- X.DE
- SHAR_EOF
- $TOUCH -am 1114014989 doc/_tech.txt &&
- chmod 0644 doc/_tech.txt ||
- echo "restore of doc/_tech.txt failed"
- set `wc -c doc/_tech.txt`;Wc_c=$1
- if test "$Wc_c" != "818"; then
- echo original size 818, current size $Wc_c
- fi
- # ============= doc/_top.txt ==============
- echo "x - extracting doc/_top.txt (Text)"
- sed 's/^X//' << 'SHAR_EOF' > doc/_top.txt &&
- X
- X.de *s
- X.H "\\$1" "\\$2" \\$3 \\$4 \\$5 \\$6 \\$7 \\$8
- X.br
- X..
- X.po 4
- X.ll 7.2i
- X.ls 1
- X.nh
- X.tp
- X.sp 2i
- X.ft B
- X.ce 10
- XECU
- X
- X(Extended Call Utility)
- X.ce 0
- X.sp 1i
- X.ce 100
- XPersonal Communications Package
- Xfor XENIX System V
- X.ce 0
- X.ft P
- X.sp 2i
- X.lp
- XWarren H. Tucker, III <wht%n4hgf@gatech.edu>
- X.sp 1i
- X.ce 100
- XTechnical Description
- XRevision 1.22 (ecu 2.80)
- X\n(mo/\n(dy/\n(yr
- X.ce 0
- X.ls 1
- X.PH "'ECU Technical Description''%'"
- X.PF "'Public Domain by wht@n4hgf''\n(mo/\n(dy/\n(yr'"
- X.nr si 2n
- X.nr Cl 9
- X.nr Ej 1
- X.nr U 1
- X.SA 1
- X.ul
- X.bp 1
- X
- SHAR_EOF
- $TOUCH -am 0507235990 doc/_top.txt &&
- chmod 0644 doc/_top.txt ||
- echo "restore of doc/_top.txt failed"
- set `wc -c doc/_top.txt`;Wc_c=$1
- if test "$Wc_c" != "516"; then
- echo original size 516, current size $Wc_c
- fi
- # ============= doc/ecu.txt ==============
- echo "x - extracting doc/ecu.txt (Text)"
- sed 's/^X//' << 'SHAR_EOF' > doc/ecu.txt &&
- X.so _top.txt
- X
- X.so _intro.txt
- X
- X.so _basic.txt
- X
- X.so _features.txt
- X
- X.so _startup.txt
- X
- X.so _icmd.txt
- X
- X.so _proc.txt
- X
- X.so _hdb.txt
- X
- X.so _tech.txt
- X
- X.so _end.txt
- SHAR_EOF
- $TOUCH -am 0711174289 doc/ecu.txt &&
- chmod 0644 doc/ecu.txt ||
- echo "restore of doc/ecu.txt failed"
- set `wc -c doc/ecu.txt`;Wc_c=$1
- if test "$Wc_c" != "155"; then
- echo original size 155, current size $Wc_c
- fi
- # ============= doc/runoff ==============
- echo "x - extracting doc/runoff (Text)"
- sed 's/^X//' << 'SHAR_EOF' > doc/runoff &&
- X#!/bin/csh
- Xunset noclobber
- Xecho 'nroff -mm ecu.txt | col > ecu.man'
- Xnroff -mm ecu.txt |& col > ecu.man
- X
- SHAR_EOF
- $TOUCH -am 0420005190 doc/runoff &&
- chmod 0755 doc/runoff ||
- echo "restore of doc/runoff failed"
- set `wc -c doc/runoff`;Wc_c=$1
- if test "$Wc_c" != "104"; then
- echo original size 104, current size $Wc_c
- fi
- # ============= models/bsd_uname.ep ==============
- if test ! -d 'models'; then
- echo "x - creating directory models"
- mkdir 'models'
- fi
- echo "x - extracting models/bsd_uname.ep (Text)"
- sed 's/^X//' << 'SHAR_EOF' > models/bsd_uname.ep &&
- X# CHK=0xFD46
- X#--------------------------------------------------------------
- X# bsd_uname.ep - get remote username from bsd system
- X# return: $s0 = username
- X# $i0 = 1 if success, else 0
- X#--------------------------------------------------------------
- X#+:EDITS:*/
- X#:07-11-1989-16:55-wht-get cmd became lgets
- X#:06-28-1989-19:36-wht-use named variables
- X#:06-25-1989-13:56-wht-new do command syntax
- X#:06-25-1989-12:33-wht-new if/while syntax
- X#:06-22-1989-13:30-wht-creation
- X
- X set $s0='whoami' # send command
- X do 'oneline' # get $s0=username
- X ifi $i0 == 0 # we bombed?
- X {
- X set $i0=%colors; color red
- X echo 'bsd_uname: get user name failed'
- X icolor $i0
- X $i0 = 0
- X }
- X
- SHAR_EOF
- $TOUCH -am 0507232990 models/bsd_uname.ep &&
- chmod 0644 models/bsd_uname.ep ||
- echo "restore of models/bsd_uname.ep failed"
- set `wc -c models/bsd_uname.ep`;Wc_c=$1
- if test "$Wc_c" != "673"; then
- echo original size 673, current size $Wc_c
- fi
- # ============= models/colors ==============
- echo "x - extracting models/colors (Text)"
- sed 's/^X//' << 'SHAR_EOF' > models/colors &&
- X#colors - ecu color file
- Xnormal lt_cyan black
- Xreverse red white
- Xnotify black gray
- Xsuccess lt_green black
- Xalert yellow black
- Xerror red black
- SHAR_EOF
- $TOUCH -am 1015041989 models/colors &&
- chmod 0644 models/colors ||
- echo "restore of models/colors failed"
- set `wc -c models/colors`;Wc_c=$1
- if test "$Wc_c" != "140"; then
- echo original size 140, current size $Wc_c
- fi
- # ============= models/dir ==============
- echo "x - extracting models/dir (Text)"
- sed 's/^X//' << 'SHAR_EOF' > models/dir &&
- X/tmp
- X/usr/tmp
- SHAR_EOF
- $TOUCH -am 1103163889 models/dir &&
- chmod 0644 models/dir ||
- echo "restore of models/dir failed"
- set `wc -c models/dir`;Wc_c=$1
- if test "$Wc_c" != "14"; then
- echo original size 14, current size $Wc_c
- fi
- # ============= models/f.ep ==============
- echo "x - extracting models/f.ep (Text)"
- sed 's/^X//' << 'SHAR_EOF' > models/f.ep &&
- X# CHK=0x1C17
- X#+------------------------------------------------------
- X# f.eq - colorful finger on remote BSD system
- X#-------------------------------------------------------
- X#+:EDITS:*/
- X#:07-11-1989-16:55-wht-get cmd became lgets
- X#:06-30-1989-18:53-wht-creation
- X
- X mkvar $icolor; $icolor = %colors
- X mkvar $itimeout; $itimeout = 50
- X send %argv(0)
- X lookfor '\n' 40
- X $s0 = ''
- X whilei 1==1
- X {
- X lgets $s00 $itimeout 5 '\n'
- X ifi $i0 == 0 continue
- X ifi %instr($s0,'% ') >= 0 break # prompt ends it
- X $itimeout = 20
- X color cyan
- X ifi %instr($s0,'Login') == 0 color gray
- X ifi %instr($s0,' i29 ') > 0 color green
- X ifi %instr($s0,' i13 ') > 0 color red
- X ifi %instr($s0,'cma') == 0 color yellow
- X ifi %instr($s0,'gfp') == 0 color lt_blue
- X ifi %instr($s0,'jts') == 0 color lt_blue
- X echo $s0
- X }
- X icolor $icolor
- X send ''
- X
- SHAR_EOF
- $TOUCH -am 0507232990 models/f.ep &&
- chmod 0640 models/f.ep ||
- echo "restore of models/f.ep failed"
- set `wc -c models/f.ep`;Wc_c=$1
- if test "$Wc_c" != "815"; then
- echo original size 815, current size $Wc_c
- fi
- # ============= models/file_test.ep ==============
- echo "x - extracting models/file_test.ep (Text)"
- sed 's/^X//' << 'SHAR_EOF' > models/file_test.ep &&
- X# CHK=0xA2AF
- X#------------------------------------------------------------
- X# ftst.ep - test ecu procedure file functions
- X#------------------------------------------------------------
- X
- X ptrace off # turn off trace mode
- X fdel 'ftst.log' # kill any previous file
- X plog 'ftst.log' # turn on logging
- X
- X echo ''
- X echo 'ftst '+%date+' '+%time
- X echo ''
- X
- X ptrace on # turn on trace mode
- X
- X set $s10 = '/tmp/ftst.tmp' # temp file name
- X fdel $s10 # test proc trace warning
- X fopen -w 0 $s10 # open file 0 for write
- X set i0=%ftell(0) # should produce 0
- X fputs 0 'abcdefghijk' # put a line in the file
- X set i0=%ftell(0) # should produce 12
- X fclose 0 n # close the file
- X
- X fopen -r 0 $s10 # open again for reading
- X fgets 0 $s0 # should produce 'abcdefghijk'
- X fseek 0 0 # rewind to read again
- X fgets 0 $s0 # should produce 'abcdefghijk'
- X fgets 0 $s0 # should produce null string
- X set $i0=%fmode(0) # test file mode function
- X fclose 0 # close the file
- X
- X fchmod 'rw-rw-r-x' $s10 # set mode using string
- X set $i0=%fmode($s10)
- X
- X fchmod 0777 $s10 # set mode using constant
- X set $i0=%fmode($s10)
- X
- X ptrace off # show file attributes
- X echo ''
- X echo -n $s10+' has '+%itos(%fsize($s10),06d)
- X echo ' (0x'+%itos(%fsize($s10),x )+') bytes'
- X echo 'accessed '+%edate(%fatime($s10))
- X echo 'modified '+%edate(%fmtime($s10))
- X echo ''
- X ptrace on
- X
- X # demonstrate "is directory", "is character",
- X # "is regular file" functions
- X set i0=%isdir($s10),i1=%ischr($s10),i2=%isreg($s10)
- X
- X fdel $s10 # should say 'deleted'
- X ptrace off
- X plog off
- SHAR_EOF
- $TOUCH -am 0507232990 models/file_test.ep &&
- chmod 0644 models/file_test.ep ||
- echo "restore of models/file_test.ep failed"
- set `wc -c models/file_test.ep`;Wc_c=$1
- if test "$Wc_c" != "1667"; then
- echo original size 1667, current size $Wc_c
- fi
- # ============= models/frame_test.ep ==============
- echo "x - extracting models/frame_test.ep (Text)"
- sed 's/^X//' << 'SHAR_EOF' > models/frame_test.ep &&
- X# CHK=0xAB0B
- X
- X set $i0 = 10
- XLABEL
- X ifi $i0 > 0
- X {
- X set $i0,$i0=$i0-1
- X ifi $i0 = 5
- X {
- X echo 'nesting works!'
- X }
- X else ifi $i0 == 4
- X {
- X echo 'else works!'
- X }
- X goto LABEL
- X }
- X
- X set $s0 = ''
- X whiles $s0 != 'aaaaa'
- X {
- X set $s0=$s0+'a'
- X ifs $s0 == 'aaaa' break
- X else echo '$s0=\''+$s0+'\''
- X }
- X
- X echo 'done!'
- SHAR_EOF
- $TOUCH -am 0507232990 models/frame_test.ep &&
- chmod 0644 models/frame_test.ep ||
- echo "restore of models/frame_test.ep failed"
- set `wc -c models/frame_test.ep`;Wc_c=$1
- if test "$Wc_c" != "317"; then
- echo original size 317, current size $Wc_c
- fi
- # ============= models/goto_test.ep ==============
- echo "x - extracting models/goto_test.ep (Text)"
- sed 's/^X//' << 'SHAR_EOF' > models/goto_test.ep &&
- X# CHK=0xE30F
- X# goto_test.ep
- X#+:EDITS:*/
- X#:06-07-1989-22:31-wht-creation
- X echo '... TRY1 goto test'; goto TRY1
- X echo '... TRY1 goto failed'
- X return
- X
- XBACK1 echo '... gotob succeeded'
- X gotob COMP
- X
- XTRY1 echo '... TRY1 goto succeeded'
- X gotob BACK1
- X
- XCOMP echo '... COMPuted goto test'; set $s0='COMP'+'UTED',$s0
- X goto $s0
- X echo '... COMP failed'
- X return
- X
- XCOMPUTED
- X echo '... computed goto worked'
- X echo '... test complete'
- X return
- X
- X# vi:set tabstop=8:
- SHAR_EOF
- $TOUCH -am 0507232990 models/goto_test.ep &&
- chmod 0644 models/goto_test.ep ||
- echo "restore of models/goto_test.ep failed"
- set `wc -c models/goto_test.ep`;Wc_c=$1
- if test "$Wc_c" != "447"; then
- echo original size 447, current size $Wc_c
- fi
- # ============= models/keys ==============
- echo "x - extracting models/keys (Text)"
- sed 's/^X//' << 'SHAR_EOF' > models/keys &&
- Xstratus
- X F1:F1:esc O q
- X F2:F2:esc O r
- X F3:F3:esc O s
- X F4:F4:esc O t
- X F5:F5:esc O u
- X F6:F6:esc O v
- X F7:F7:esc O w
- X F8:status:dc4
- X F9:no status:nl
- X F10:redisp:esc O y
- X F11:redisp:syn
- X PGDN:cancel:esc O Q
- X END:enter:esc O M
- X PGUP:dispform:esc O R
- X CUU:^:dle
- X CUD:v:so
- X CUL:<:stx
- X CUR:>:ack
- X
- Xremecu
- X F1:Home:0xC8
- X F2:End:0xC6
- SHAR_EOF
- $TOUCH -am 1103163889 models/keys &&
- chmod 0644 models/keys ||
- echo "restore of models/keys failed"
- set `wc -c models/keys`;Wc_c=$1
- if test "$Wc_c" != "322"; then
- echo original size 322, current size $Wc_c
- fi
- # ============= models/lookfortest.ep ==============
- echo "x - extracting models/lookfortest.ep (Text)"
- sed 's/^X//' << 'SHAR_EOF' > models/lookfortest.ep &&
- X# CHK=0xFA5C
- X# lookfor_test.ep (needs a modem already attached)
- X
- X send 'ate0q1'
- X nap 20
- X flush
- X
- X send 'at'
- X
- X lookfor 'OK'
- X ifi $i0 == 1 echo '... got false success'; return
- X ifi $i0 <> 0 echo '... got illogical result';set $i0;return
- X echo '... got good result for failure to read'
- X
- X send 'ate1q0'
- X
- X lookfor -e 'OK'+%chr(0x0D)+%chr(0x0A) 20
- X ifi $i0 == 0 echo '... got false failure'; return
- X ifi $i0 <> 1 echo '... got illogical result';set $i0;return
- X echo '... got good result for read'
- X
- X
- X
- X# vi: set tabstop=8:
- SHAR_EOF
- $TOUCH -am 0507232990 models/lookfortest.ep &&
- chmod 0644 models/lookfortest.ep ||
- echo "restore of models/lookfortest.ep failed"
- set `wc -c models/lookfortest.ep`;Wc_c=$1
- if test "$Wc_c" != "515"; then
- echo original size 515, current size $Wc_c
- fi
- # ============= models/mhack_test.ep ==============
- echo "x - extracting models/mhack_test.ep (Text)"
- sed 's/^X//' << 'SHAR_EOF' > models/mhack_test.ep &&
- X# CHK=0xEC1B
- X#---------------------------------------------------------------------------
- X# mhack_test.ep - test %mhack while showing entertaining colors
- X# also useful to get a feeling for how fast the procedure language can be
- X#---------------------------------------------------------------------------
- X#+:EDITS:
- X#:03-16-1990-05:25-wht@n4hgf-requires ecu x2.64 or later
- X
- X echo 'SIGINT to quit\n'
- X $i20 = %colors
- X $i21 = %colors & 0xFFFFF0FF
- X whilei 1==1
- X {
- X $i0 = %mhack
- X $i1 = $i0 & 0xF00
- X icolor $i21 | $i1
- X echo -n %itos($i0,8d)+%chr(0x0d)
- X }
- X echo ''
- X icolor $i20
- X
- SHAR_EOF
- $TOUCH -am 0507232990 models/mhack_test.ep &&
- chmod 0644 models/mhack_test.ep ||
- echo "restore of models/mhack_test.ep failed"
- set `wc -c models/mhack_test.ep`;Wc_c=$1
- if test "$Wc_c" != "578"; then
- echo original size 578, current size $Wc_c
- fi
- # ============= models/mkdir.ep ==============
- echo "x - extracting models/mkdir.ep (Text)"
- sed 's/^X//' << 'SHAR_EOF' > models/mkdir.ep &&
- X# CHK=0x91D9
- X system 'mkdir '+%argv(1)
- SHAR_EOF
- $TOUCH -am 0507232990 models/mkdir.ep &&
- chmod 0644 models/mkdir.ep ||
- echo "restore of models/mkdir.ep failed"
- set `wc -c models/mkdir.ep`;Wc_c=$1
- if test "$Wc_c" != "40"; then
- echo original size 40, current size $Wc_c
- fi
- # ============= models/oneline.ep ==============
- echo "x - extracting models/oneline.ep (Text)"
- sed 's/^X//' << 'SHAR_EOF' > models/oneline.ep &&
- X# CHK=0xF093
- X#--------------------------------------------------------------
- X# oneline.ep
- X#
- X# send command in $s0, expecting a one line response
- X# and a csh prompt ending in '% '
- X#
- X# returns: $s0 = one line response in $s0 if success
- X# $i0 = 1 if success, else 0
- X#--------------------------------------------------------------
- X#+:EDITS:*/
- X#:07-11-1989-16:55-wht-get cmd became lgets
- X#:06-28-1989-19:36-wht-use named variables
- X#:06-25-1989-13:56-wht-new do command syntax
- X#:06-25-1989-12:33-wht-new if/while syntax
- X#:06-22-1989-13:30-wht-creation
- X
- X mkvar $icsave; $icsave = %colors
- X color gray
- X send $s0 # send command
- X lookfor -e %chr(0x0A) 50 # scan command echo
- X ifi $i0 == 0 icolor $i2;return # if not found, return
- X lgets -e $s0 500 5 '\n' # get one line response
- X lookfor '% ' 50 # get prompt, don't echo
- X # $i0 = 1 if prompt, else 0
- X icolor $icsave
- SHAR_EOF
- $TOUCH -am 0507232990 models/oneline.ep &&
- chmod 0644 models/oneline.ep ||
- echo "restore of models/oneline.ep failed"
- set `wc -c models/oneline.ep`;Wc_c=$1
- if test "$Wc_c" != "877"; then
- echo original size 877, current size $Wc_c
- fi
- # ============= models/opuslogin.ep ==============
- echo "x - extracting models/opuslogin.ep (Text)"
- sed 's/^X//' << 'SHAR_EOF' > models/opuslogin.ep &&
- X# CHK=0xE753
- X#+-----------------------------------------------------------------
- X# opuslogin.ep - ecu UNIX login procedure
- X# wht%n4hgf@gatech.edu
- X#
- X# %argv(1) = remote name
- X# %argv(2) = first name
- X# %argv(3) = last name
- X# %argv(4) = password
- X#+-----------------------------------------------------------------
- X#+:EDITS:*/
- X#:07-11-1989-16:55-wht-get cmd became lgets
- X#:06-28-1989-19:36-wht-use named variables
- X#:06-25-1989-13:56-wht-new do command syntax
- X#:06-25-1989-12:33-wht-new if/while syntax
- X#:06-23-1989-19:46-wht-improved hayes dialer reduces need to report dial fail
- X#:06-19-1989-22:50-wht-use while and if statements
- X#:06-14-1989-15:58-wht-add login capability when already connected
- X#:06-11-1989-23:37-wht-creation
- X
- X mkvar $i_csave,$i_ltimeout,$i_retries
- X
- X $i_csave = %colors
- X $i_retries=3
- X
- X color red; echo -n '\nauto-logon to '
- X color yellow; echo -n %argv(1)
- X color red; echo ' on '+%date+' at '+%time+'\n'
- X
- X ifi %argc != 5 # not enough args
- X {
- X color red
- X echo %argv(0)+' needs 5 arguments (got '+%itos(%argc)+')'
- X goto SORRY1
- X }
- X
- X ifi %conn == 0 goto DIAL
- X
- X ifs %rname == %argv(1)
- X {
- X color brown; echo -n 'already connected to '
- X color yellow; echo %rname
- X goto GET_LOGIN_PROMPT_RETRY
- X }
- X
- XHANGUP
- X ifi %conn <> 0 echo 'hanging up on '+%rname; hangup
- X
- XDIAL
- X color green
- X dial %argv(1); set $i1=$i0 #save dial result in $i1
- X ifi $i1 == 2 color red; echo 'interrupted'; goto SORRY
- X ifi $i1 != 0 goto SORRY
- X
- XTEST_MODEM_RESULT
- X ifs $s0 != 'CONNECT '+%itos(%baud)
- X color yellow; echo 'baud rate mismatch ... retrying'; goto HANGUP
- X
- X# give name to remote
- X lookfor -e 'FIRST name: ' 150
- X send %argv(2)
- X lookfor -e 'LAST name: ' 150
- X send %argv(3)
- X
- X lookfor -e '[Y,n]? ' 40
- X send 'Y'
- X
- X lookfor -e 'Password: ' 80
- X send %argv(4)
- X lookfor -e '\n'
- X set $i0=0
- X goto SETCOLOR_AND_RETURN_STATUS
- X
- X# procedure failed
- XSORRY
- X echo ''
- X color red
- X echo '....... sorry'
- X set $i0=0
- X goto SETCOLOR_AND_RETURN_STATUS
- X
- XSORRY1
- X echo ''
- X color red
- X echo '....... sorry'
- X set $i0=1
- X
- XSETCOLOR_AND_RETURN_STATUS
- X icolor $i_csave
- X return $i0
- X
- X# vi:set tabstop=4 shiftwidth=4:
- SHAR_EOF
- $TOUCH -am 0507233390 models/opuslogin.ep &&
- chmod 0644 models/opuslogin.ep ||
- echo "restore of models/opuslogin.ep failed"
- set `wc -c models/opuslogin.ep`;Wc_c=$1
- if test "$Wc_c" != "2082"; then
- echo original size 2082, current size $Wc_c
- fi
- # ============= models/p.ep ==============
- echo "x - extracting models/p.ep (Text)"
- sed 's/^X//' << 'SHAR_EOF' > models/p.ep &&
- X# CHK=0x8848
- X#+---------------------------------------------------------
- X# p.eq - colorful, selective ps -aux on remote BSD system
- X#----------------------------------------------------------
- X#+:EDITS:*/
- X#:07-11-1989-16:55-wht-get cmd became lgets
- X#:06-30-1989-18:53-wht-creation
- X
- X mkvar $icolor; $icolor = %colors
- X mkvar $itimeout; $itimeout = 50
- X send 'ps -aux'
- X lookfor '\n' 40
- X $s0 = ''
- X whilei 1==1
- X {
- X lgets $s00 $itimeout 5 '\n'
- X ifi $i0 == 0 continue
- X $itimeout = 20
- X ifi %instr($s0,'% ') >= 0 break # prompt ends it
- X color cyan
- X ifi %instr($s0,'getty') >= 0 continue
- X ifi %instr($s0,'/etc') >= 0 continue
- X ifi %instr($s0,'rlogin') >= 0 continue
- X ifi %instr($s0,'biod') >= 0 continue
- X ifi %instr($s0,'csh') >= 0 continue
- X ifi %instr($s0,'/usr/lib') >= 0 continue
- X ifi %instr($s0,' i29 ') > 0 color green
- X ifi %instr($s0,' i13 ') > 0 color red
- X ifi %instr($s0,'cma') == 0 color yellow
- X ifi %instr($s0,'gfp') == 0 color lt_blue
- X ifi %instr($s0,'jts') == 0 color lt_blue
- X ifi %instr($s0,'UUCP') >= 0 color red
- X ifi %instr($s0,'uu') >= 0 color red
- X echo $s0
- X }
- X icolor $icolor
- X send ''
- X
- SHAR_EOF
- $TOUCH -am 0507232990 models/p.ep &&
- chmod 0640 models/p.ep ||
- echo "restore of models/p.ep failed"
- set `wc -c models/p.ep`;Wc_c=$1
- if test "$Wc_c" != "1110"; then
- echo original size 1110, current size $Wc_c
- fi
- # ============= models/phone ==============
- echo "x - extracting models/phone (Text)"
- sed 's/^X//' << 'SHAR_EOF' > models/phone &&
- X# when saving this file, ECU will preserve commented lines
- X#alpha2:1(714)821-9672::2400:N:alphacm rotary 2 (uucp)
- X#kermit:1(419)537-4411::1200:E:Kermit
- X#sco2:1(408)425-3502::2400:N:sosco uucp
- Xalphacm:1(714)821-9671::2400:N:alphacm rotary 1
- Xnavobs:1(202)653-0351::1200:N:Naval Observatory Time
- Xsco:1(408)426-9495::2400:N:SCO Tech Services (SOS)
- SHAR_EOF
- $TOUCH -am 1103163789 models/phone &&
- chmod 0644 models/phone ||
- echo "restore of models/phone failed"
- set `wc -c models/phone`;Wc_c=$1
- if test "$Wc_c" != "344"; then
- echo original size 344, current size $Wc_c
- fi
- # ============= models/phrases ==============
- echo "x - extracting models/phrases (Text)"
- sed 's/^X//' << 'SHAR_EOF' > models/phrases &&
- Xstty:stty intr ^C kill ^U erase ^H^r
- Xmail-csh:mail emory\!tridom\!n4hgf\!wht^r
- Xmail-sh:mail emory!tridom!n4hgf!wht^r
- SHAR_EOF
- $TOUCH -am 1103164089 models/phrases &&
- chmod 0604 models/phrases ||
- echo "restore of models/phrases failed"
- set `wc -c models/phrases`;Wc_c=$1
- if test "$Wc_c" != "117"; then
- echo original size 117, current size $Wc_c
- fi
- # ============= models/ps.ep ==============
- echo "x - extracting models/ps.ep (Text)"
- sed 's/^X//' << 'SHAR_EOF' > models/ps.ep &&
- X# CHK=0xDA50
- X#+------------------------------------------------------
- X# p.eq
- X#-------------------------------------------------------
- X#+:EDITS:*/
- X#:07-11-1989-16:55-wht-get cmd became lgets
- X#:06-30-1989-18:53-wht-creation
- X
- X mkvar $icolor; $icolor = %colors
- X send %argv(0)+' '+%argv(1)+' '+%argv(2)
- X lookfor '\n' 40
- X $s0 = ''
- X whilei 1==1
- X {
- X lgets $s0 60 60 '\n'
- X color cyan
- X ifi %instr($s0,'(getty)' >= 0 continue
- X else ifi %instr($s0,'(tcsh)' >= 0 continue
- X else ifi %instr($s0,'(csh)' >= 0 continue
- X else ifi %instr($s0,'(sh)' >= 0 continue
- X else ifi %instr($s0,'/etc/init' >= 0 continue
- X else ifi %instr($s0,'% ') >= 0 break
- X else ifi %instr($s0,'USER') == 0 color gray
- X else ifi %instr($s0,' i29 ') > 0 color red
- X else ifi %instr($s0,' i13 ') > 0 color green
- X else ifi %instr($s0,'cma') == 0 color yellow
- X echo $s0
- X }
- X icolor $icolor
- X send ''
- X
- SHAR_EOF
- $TOUCH -am 0507232990 models/ps.ep &&
- chmod 0644 models/ps.ep ||
- echo "restore of models/ps.ep failed"
- set `wc -c models/ps.ep`;Wc_c=$1
- if test "$Wc_c" != "863"; then
- echo original size 863, current size $Wc_c
- fi
- # ============= models/put_ecu.ep ==============
- echo "x - extracting models/put_ecu.ep (Text)"
- sed 's/^X//' << 'SHAR_EOF' > models/put_ecu.ep &&
- X# CHK=0x6289
- X#--------------------------------------------------------------
- X# put_ecu.ep - update remote copy of ecu sources
- X#--------------------------------------------------------------
- X#+:EDITS:*/
- X#:07-11-1989-16:55-wht-get cmd became lgets
- X#:06-28-1989-19:36-wht-use named variables
- X#:06-25-1989-14:28-wht-use rz_update
- X
- X $s10 = %rname
- X ifi %instr($s10,'tridom') == 0
- X $s10 = 'tridom'
- X
- X ifs $s10 == 'tridom'
- X {
- X $s0 = '/u3/sd/wht/src/ecu'
- X $s1 = '/u1/src/ecu'
- X $s2 = '`ff \'*.c\' \'*.h\' Makefile \'*.ep\' \'.mi\' \'*.txt\' \'*.man\'` xsel386/*'
- X $s3 = 'wht'
- X goto CALL_SZ_UPDATE
- X }
- X else ifs $s10== 'ki4xo'
- X {
- X $s0 = '/user/wht/src/ecu'
- X $s1 = '/u1/src/ecu'
- X $s2 = '{.,z}/{Makefile,*.{c,h}} `ff \'*.ep\' \'.mi\' \'*.man\'` xsel386/*'
- X $s3 = 'wht'
- X goto CALL_SZ_UPDATE
- X }
- X else ifs $s10== 'coke-jsm'
- X {
- X $i39=%colors
- X color red; echo '\n\nHAVE YOU MADE A NO-SELECT VERSION???????\n\n'
- X mkvar $s_rpwd(20)
- X echo -n 'root password? ' ; $s_rpwd = %cgets
- X icolor $i39
- X $s0 = '/usr/wht/bin'
- X $s1 = '/u1/src/ecu'
- X $s2 = 'ecu'
- X $s3 = 'wht'
- X do 'sz_update' $s0 $s1 $s2 $s3 %argv(0)
- X lookfor '% ' 40
- X $s0 = '/usr/wht/bin'
- X $s1 = '/usr/wht/bin'
- X $s2 = 'ecusz ecurz ecusea'
- X $s3 = 'wht'
- X do 'sz_update' $s0 $s1 $s2 $s3 %argv(0)
- X lookfor '% ' 40
- X $s0 = '/usr/wht'
- X $s1 = '/u1/src/ecu/doc'
- X $s2 = '*.man'
- X $s3 = 'wht'
- X do 'sz_update' $s0 $s1 $s2 $s3 %argv(0)
- X lookfor '% ' 40
- X $s0 = '/usr/wht/.ecu'
- X $s1 = '/u1/src/ecu/models'
- X $s2 = '*'
- X $s3 = 'wht'
- X do 'sz_update' $s0 $s1 $s2 $s3 %argv(0)
- X lookfor '% ' 40
- X $s0 = '/usr/lib/ecu'
- X $s1 = $s0
- X $s2 = '*'
- X $s3 = ''
- X do 'su-csh' 'root' $s_rpwd
- X do 'sz_update' $s0 $s1 $s2 $s3 %argv(0)
- X send -e 'chmod u+s /usr/lib/ecu/ecuungetty'
- X send %chr(0x04)
- X return
- X }
- X else echo 'not to '+$s10+' you don\'t'
- X
- X# $s0 = remote directory
- X# $s1 = local directory
- X# $s2 = file list
- X# $s3 = necessary username on remote system
- XCALL_SZ_UPDATE
- X do 'sz_update' $s0 $s1 $s2 $s3 %argv(0)
- SHAR_EOF
- $TOUCH -am 0507232990 models/put_ecu.ep &&
- chmod 0644 models/put_ecu.ep ||
- echo "restore of models/put_ecu.ep failed"
- set `wc -c models/put_ecu.ep`;Wc_c=$1
- if test "$Wc_c" != "1963"; then
- echo original size 1963, current size $Wc_c
- fi
- # ============= models/root.ep ==============
- echo "x - extracting models/root.ep (Text)"
- sed 's/^X//' << 'SHAR_EOF' > models/root.ep &&
- X# CHK=0x8FE9
- X
- X# CHK=0x067D
- X#+----------------------------------------------
- X# su-root.ep
- X#-----------------------------------------------
- X#+:EDITS:*/
- X#:07-11-1989-16:55-wht-get cmd became lgets
- X#:06-28-1989-19:36-wht-use named variables
- X#:06-27-1989-17:02-wht-working
- X
- X mkvar icsave;$icsave = %colors
- X color lt_blue black
- X echo -n 'remote root password? '
- X color black black
- X $s0 = %cgets
- X icolor $icsave
- X do 'su' 'root' $s0
- X $s0 = '' # forget password
- X lookfor '% ' 100 # swallow prompt
- X send 'source ~wht/.cshrc'
- SHAR_EOF
- $TOUCH -am 0507232990 models/root.ep &&
- chmod 0644 models/root.ep ||
- echo "restore of models/root.ep failed"
- set `wc -c models/root.ep`;Wc_c=$1
- if test "$Wc_c" != "518"; then
- echo original size 518, current size $Wc_c
- fi
- # ============= models/rz_update.ep ==============
- echo "x - extracting models/rz_update.ep (Text)"
- sed 's/^X//' << 'SHAR_EOF' > models/rz_update.ep &&
- X# CHK=0x3514
- X#--------------------------------------------------------------
- X# rz_update.ep - update local directory
- X#
- X# parameters:
- X# %argv(1) = remote directory to copy from
- X# %argv(2) = local directory to copy to
- X# %argv(3) = file list to get
- X# %argv(4) = remote username needed, if any, else null
- X# if %argv(4) not null, 'su_'+%argv(4)+".ep" must
- X# exist to su to remote
- X# %argv(5) name of superior procedure
- X#
- X#--------------------------------------------------------------
- X#+:EDITS:*/
- X#:07-11-1989-16:55-wht-get cmd became lgets
- X#:06-28-1989-19:36-wht-use named variables
- X#:06-25-1989-13:56-wht-new do command syntax
- X#:06-25-1989-12:33-wht-new if/while syntax
- X#:06-22-1989-13:30-wht-creation
- X
- X# variable usage
- X mkvar $i_csave # color settings at entry to procedure
- X mkvar $i_rtnval # return code
- X mkvar $i_suflag # true if su occurred
- X mkvar $s_origdir(128) # original working directory
- X mkvar $s_rdir(128) # remote directory we started with
- X mkvar $s_ruser(16) # remote username we started with before su
- X mkvar $s_xtitle(64) # title for xfer
- X
- X $i_csave=%colors # get colors at entry
- X
- X $s_xtitle = 'Connected to '+%rname
- X ifs %argv(5) != ''
- X $s_xtitle = $s_xtitle+' - procedure '+%argv(5)
- X
- X# check to make sure we are connected
- X ifi %conn == 0
- X {
- X color red; echo 'not connected to anyone!'
- X goto SORRY
- X }
- X color lt_blue; echo 'Connected to '+%rname
- X
- X# save local current directory and change to target
- X $s_origdir=%dir
- X color brown
- X ifs $s_origdir == %argv(2)
- X echo -n 'local directory already '
- X else
- X {
- X cd %argv(2)
- X echo -n 'local directory set to '
- X }
- X color yellow; echo %dir
- X
- X# make sure remote username ok
- X ifs %argv(4) == '' goto REMOTE_CD # if any remote username
- X do 'bsd_uname' # get $s0=username
- X ifi $i0 == 0 goto SORRY # test failure
- X $s_ruser = $s0 # save original remote username
- X ifs $s0 != %argv(4)
- X { # need to su
- X color brown
- X echo -n 'remote username '
- X color yellow
- X echo -n $s0
- X color brown
- X echo ' ... su to '+%argv(4)+' now'
- X color gray
- X do 'su_'+%argv(4) # call proc, which calls su.ep
- X lookfor '% ' 50 # su leaves prompt in buffer: swallow
- X do 'bsd_uname' # make sure we su'd
- X ifi $i0 == 0 goto SORRY
- X ifs $s0 != %argv(4) # failed to su?
- X {
- X color red;echo 'su to '+%argv(4)+' failed'
- X goto SORRY
- X }
- X $i_suflag = 1 # remember we su'd
- X } # now we are proper username on remote
- X
- X# establish proper remote working directory
- XREMOTE_CD
- X color gray
- X $s0 = 'pwd';do 'oneline' # save old remote ...
- X $s_rdir = $s0 # ... directory in $s_rdir
- X ifs $s_rdir != %argv(1) # if cd needed, do it
- X {
- X send 'cd '+%argv(1) # remote cd
- X lookfor -e '\n' 50 # echo command
- X lookfor '% ' 50 # swallow prompt
- X $s0 = 'pwd'
- X do 'oneline' # make sure we got there
- X ifs $s0 != %argv(1) # dir change failed
- X {
- X color red;echo 'remote cd failed'
- X goto SORRY;
- X }
- X }
- X color brown; echo -n 'remote directory '
- X color yellow; echo -n %argv(1)
- X color brown; echo ' ... starting transfer now'
- X
- X# transfer files
- X color lt_blue
- X send 'sz -n -f '+%argv(3)
- X lookfor -e '\n' 50 # echo remote command
- X ifi $i0 == 0 # command failed?
- X {
- X color red; echo 'sz command failed or garbled echo'
- X goto SORRY
- X }
- X color brown
- X echo 'waiting for sz to start'
- X nap 10
- X color gray
- X# $s5 = '**'+%chr(0x18)+'B' # ZMODEM header
- X lgets $s0 150 10 '\n' # wait 15 secs for start
- X ifi %instr($s0,'rz') < 0 # check for 'rz' startup from remote
- X {
- X color white;
- X echo '\n'+$s0+'\n'
- X color red
- X echo 'sz protocol failure or trigger garbled'
- X goto SORRY
- X }
- X icolor $i_csave # restore colors at entry
- X rz -l $s_xtitle
- X ifi $i0 != 0 # whoops
- X {
- X color red; echo -n '\nTRANSFER FAILED ... '
- X ifi $i0 == 0x100 echo 'interrupt'
- X ifi $i0 != 0x100 echo 'termination status '+%itos($i0,04d)
- X goto SORRY
- X }
- X lookfor '% ' 50 # swallow prompt
- X goto RETURN
- X
- XSORRY # whoops
- X color red;echo 'rz_update failed ... sorry'
- X $i_rtnval = 1 # return error
- X
- XRETURN
- X echo ''
- X color brown; echo -n 'remote user name '
- X color yellow
- X ifi $i_suflag != 0 # we su'd
- X {
- X send -n %chr(0x04) # will force a new prompt from remote
- X echo -n $s_ruser
- X color brown; echo ' restored (sent ^D to '+%argv(4)+' shell)'
- X lookfor '% ' 50 # swallow prompt
- X }
- X else
- X color brown; echo 'unchanged'
- X
- X ifs $s_rdir != %argv(1) # if we did a remote cd
- X {
- X send 'cd '+$s_rdir # restore original
- X lookfor '\n'
- X color brown; echo -n 'remote working directory '
- X color yellow; echo -n $s_rdir
- X color brown; echo ' restored'
- X }
- X else
- X {
- X send '' # spark a prompt
- X color brown; echo -n 'remote working directory '
- X color yellow; echo -n $s_rdir
- X color brown; echo ' unchanged'
- X }
- X
- X ifs $s_origdir != %dir # restore original directory
- X {
- X cd $s_origdir
- X color brown; echo -n 'local working directory '
- X color yellow; echo -n $s_origdir
- X color brown; echo ' restored'
- X }
- X
- X icolor $i_csave # restore colors at entry
- X echo ''
- X return $i_rtnval # return selected error code (bomb procedure if error)
- SHAR_EOF
- $TOUCH -am 0507232990 models/rz_update.ep &&
- chmod 0644 models/rz_update.ep ||
- echo "restore of models/rz_update.ep failed"
- set `wc -c models/rz_update.ep`;Wc_c=$1
- if test "$Wc_c" != "4983"; then
- echo original size 4983, current size $Wc_c
- fi
- # ============= models/senddate.ep ==============
- echo "x - extracting models/senddate.ep (Text)"
- sed 's/^X//' << 'SHAR_EOF' > models/senddate.ep &&
- X# CHK=0x067D
- X#+----------------------------------------------
- X# senddate.ep
- X#-----------------------------------------------
- X#+:EDITS:*/
- X#:07-11-1989-16:55-wht-get cmd became lgets
- X#:06-28-1989-19:36-wht-use named variables
- X#:06-27-1989-17:02-wht-working
- X
- X mkvar icsave;$icsave = %colors
- X color blue
- X echo -n 'remote root password? '
- X color black
- X $s0 = %cgets
- X icolor $icsave
- X do 'su' 'root' $s0
- X $s0 = '' # forget password
- X lookfor '% ' 50 # swallow prompt
- X send 'date'
- X lookfor -e '% ' 50
- X system -l 'senddate'
- X lookfor -e quiet 20
- X send -n %chr(0x04)
- SHAR_EOF
- $TOUCH -am 0507232990 models/senddate.ep &&
- chmod 0644 models/senddate.ep ||
- echo "restore of models/senddate.ep failed"
- set `wc -c models/senddate.ep`;Wc_c=$1
- if test "$Wc_c" != "557"; then
- echo original size 557, current size $Wc_c
- fi
- # ============= models/su.ep ==============
- echo "x - extracting models/su.ep (Text)"
- sed 's/^X//' << 'SHAR_EOF' > models/su.ep &&
- X# CHK=0x120D
- X#+---------------------------------------------------------
- X# su.ep - switch user at remote
- X# wht%n4hgf@gatech.edu
- X#
- X# do su 'username' 'password' ['.']
- X#
- X# expects new user to be running csh
- X#----------------------------------------------------------
- X#+:EDITS:*/
- X#:07-11-1989-16:55-wht-get cmd became lgets
- X#:06-28-1989-19:36-wht-use named variables
- X#:06-27-1989-12:43-wht-"get prompt" message was wrong
- X#:06-25-1989-13:56-wht-new do command syntax
- X#:06-25-1989-12:33-wht-new if/while syntax
- X#:06-16-1989-18:12-wht-creation
- X
- X mkvar icsave; $icsave = %colors
- X
- X color gray
- X send 'su '+%argv(1)
- X lookfor -e 'word:' 70
- X ifi $i0 == 0
- X {
- X color red;echo 'su: failed to get password prompt'
- X icolor $icsave; return 1
- X }
- X send %argv(2); lookfor '\n' 50 # send password
- X echo ''
- X lgets $s0 70 5 '\n'
- X ifi %instr($s0,'Sorry') >= 0
- X {
- X color red;echo 'su: remote said "Sorry"'
- X icolor $icsave; return 1
- X }
- X nap 5 # wait .5 sec
- X send 'set prompt="% "' # set '% ' as prompt
- X lookfor '\n' 20 # swallow echo of set command
- X lookfor '% ' 60 # look for new prompt
- X ifi $i0 == 0
- X {
- X color lt_red
- X echo 'timeout on prompt ... system may be slow ... waiting 5 more secs'
- X color gray
- X lookfor '% ' 50 # look for new prompt
- X }
- X ifi $i0 == 0
- X {
- X color red;echo 'su: failed to "get prompt" echo'
- X icolor $icsave; return 2
- X }
- X ifs %argv(3) == '.'
- X send 'source ~wht/.cshrc'
- X else
- X send ''; lookfor '\n' 50 # kick off another prompt
- X icolor $icsave
- SHAR_EOF
- $TOUCH -am 0507233390 models/su.ep &&
- chmod 0644 models/su.ep ||
- echo "restore of models/su.ep failed"
- set `wc -c models/su.ep`;Wc_c=$1
- if test "$Wc_c" != "1465"; then
- echo original size 1465, current size $Wc_c
- fi
- echo "End of part 28, continue with part 29"
- exit 0
-
-