From pa.dec.com!decwrl!uunet!sparky!kent Sun Aug 11 15:54:21 PDT 1991
Article: 2598 of comp.sources.misc
Newsgroups: comp.sources.misc
Path: pa.dec.com!decwrl!uunet!sparky!kent
From: Warren Tucker <wht@n4hgf.Mt-Park.GA.US>
Subject:  v21i088:  ecu - ECU async comm package rev 3.10, Part36/37
Message-ID: <1991Aug5.212049.8606@sparky.IMD.Sterling.COM>
X-Md4-Signature: 10bca3f130d782fc54156101202a129b
Sender: kent@sparky.IMD.Sterling.COM (Kent Landfield)
Organization: Sterling Software, IMD
References: <csm-v21i053=ecu.215539@sparky.imd.sterling.com>
Date: Mon, 5 Aug 1991 21:20:49 GMT
Approved: kent@sparky.imd.sterling.com
Lines: 1809

Submitted-by: Warren Tucker <wht@n4hgf.Mt-Park.GA.US>
Posting-number: Volume 21, Issue 88
Archive-name: ecu/part36
Environment: SCO, XENIX, ISC
Supersedes: ecu3: Volume 16, Issue 25-59

---- Cut Here and feed the following to sh ----
#!/bin/sh
# this is ecu310.36 (part 36 of ecu310)
# do not concatenate these parts, unpack them in order with /bin/sh
# file models/file_test.ep continued
#
if touch 2>&1 | fgrep 'amc' > /dev/null
 then TOUCH=touch
 else TOUCH=true
fi
if test ! -r _shar_seq_.tmp; then
	echo 'Please unpack part 1 first!'
	exit 1
fi
(read Scheck
 if test "$Scheck" != 36; then
	echo Please unpack part "$Scheck" next!
	exit 1
 else
	exit 0
 fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
	echo 'x - still skipping models/file_test.ep'
else
echo 'x - continuing file models/file_test.ep'
sed 's/^X//' << 'SHAR_EOF' >> 'models/file_test.ep' &&
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
echo 'File models/file_test.ep is complete' &&
$TOUCH -am 0429171591 'models/file_test.ep' &&
chmod 0644 models/file_test.ep ||
echo 'restore of models/file_test.ep failed'
Wc_c="`wc -c < 'models/file_test.ep'`"
test 1667 -eq "$Wc_c" ||
	echo 'models/file_test.ep: original size 1667, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/frame_test.ep ==============
if test -f 'models/frame_test.ep' -a X"$1" != X"-c"; then
	echo 'x - skipping models/frame_test.ep (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
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 0429171591 'models/frame_test.ep' &&
chmod 0644 models/frame_test.ep ||
echo 'restore of models/frame_test.ep failed'
Wc_c="`wc -c < 'models/frame_test.ep'`"
test 317 -eq "$Wc_c" ||
	echo 'models/frame_test.ep: original size 317, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/gosub.ep ==============
if test -f 'models/gosub.ep' -a X"$1" != X"-c"; then
	echo 'x - skipping models/gosub.ep (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting models/gosub.ep (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'models/gosub.ep' &&
X#---------------------
X# gosub.ep
X#---------------------
X
X	echo 'main'; gosub SUB; echo 'back to main'
X	return
X
XSUB
X	echo 'sub'
X	gosub SUB2
X	echo 'back to sub'
X	return
X
X
XSUB2
X	echo 'sub2'
X	return
X
X
SHAR_EOF
$TOUCH -am 0429171591 'models/gosub.ep' &&
chmod 0644 models/gosub.ep ||
echo 'restore of models/gosub.ep failed'
Wc_c="`wc -c < 'models/gosub.ep'`"
test 198 -eq "$Wc_c" ||
	echo 'models/gosub.ep: original size 198, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/goto_test.ep ==============
if test -f 'models/goto_test.ep' -a X"$1" != X"-c"; then
	echo 'x - skipping models/goto_test.ep (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
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 0429171591 'models/goto_test.ep' &&
chmod 0644 models/goto_test.ep ||
echo 'restore of models/goto_test.ep failed'
Wc_c="`wc -c < 'models/goto_test.ep'`"
test 447 -eq "$Wc_c" ||
	echo 'models/goto_test.ep: original size 447, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/if_test.ep ==============
if test -f 'models/if_test.ep' -a X"$1" != X"-c"; then
	echo 'x - skipping models/if_test.ep (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting models/if_test.ep (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'models/if_test.ep' &&
X
X	ifz 0
X		echo 'ifz works'
X	else
X		echo 'ifz broken'
X
X	ifnz 1
X		echo 'ifnz works'
X	else
X		echo 'ifnz broken'
X
X	iflt -5
X		echo 'iflt works'
X	else
X		echo 'iflt broken'
X
X	ifgt 50
X		echo 'ifgt works'
X	else
X		echo 'ifgt broken'
X
X
X	ifz 34
X		echo 'bad news 1'
X	else ifgt -5
X		echo 'bad news 2'
X	else ifge -5
X		echo 'bad news 3'
X	else iflt 5
X		echo 'bad news 4'
X	else ifle 5
X		echo 'bad news 5'
X	else
X		echo 'compound if works'
SHAR_EOF
$TOUCH -am 0429171591 'models/if_test.ep' &&
chmod 0644 models/if_test.ep ||
echo 'restore of models/if_test.ep failed'
Wc_c="`wc -c < 'models/if_test.ep'`"
test 420 -eq "$Wc_c" ||
	echo 'models/if_test.ep: original size 420, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/keys ==============
if test -f 'models/keys' -a X"$1" != X"-c"; then
	echo 'x - skipping models/keys (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
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 0429171591 'models/keys' &&
chmod 0644 models/keys ||
echo 'restore of models/keys failed'
Wc_c="`wc -c < 'models/keys'`"
test 322 -eq "$Wc_c" ||
	echo 'models/keys: original size 322, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/lookfortest.ep ==============
if test -f 'models/lookfortest.ep' -a X"$1" != X"-c"; then
	echo 'x - skipping models/lookfortest.ep (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
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 0429171591 'models/lookfortest.ep' &&
chmod 0644 models/lookfortest.ep ||
echo 'restore of models/lookfortest.ep failed'
Wc_c="`wc -c < 'models/lookfortest.ep'`"
test 515 -eq "$Wc_c" ||
	echo 'models/lookfortest.ep: original size 515, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/mhack_test.ep ==============
if test -f 'models/mhack_test.ep' -a X"$1" != X"-c"; then
	echo 'x - skipping models/mhack_test.ep (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
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 0429171591 'models/mhack_test.ep' &&
chmod 0644 models/mhack_test.ep ||
echo 'restore of models/mhack_test.ep failed'
Wc_c="`wc -c < 'models/mhack_test.ep'`"
test 578 -eq "$Wc_c" ||
	echo 'models/mhack_test.ep: original size 578, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/mkdir.ep ==============
if test -f 'models/mkdir.ep' -a X"$1" != X"-c"; then
	echo 'x - skipping models/mkdir.ep (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
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 0429171591 'models/mkdir.ep' &&
chmod 0644 models/mkdir.ep ||
echo 'restore of models/mkdir.ep failed'
Wc_c="`wc -c < 'models/mkdir.ep'`"
test 40 -eq "$Wc_c" ||
	echo 'models/mkdir.ep: original size 40, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/nonansikeys ==============
if test -f 'models/nonansikeys' -a X"$1" != X"-c"; then
	echo 'x - skipping models/nonansikeys (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting models/nonansikeys (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'models/nonansikeys' &&
X#+------------------------------------------------------------------------
X# ECU 3.0 nonansikeys
X#
X# This file contains mapping information to convert non-ANSI
X# keyboard function keys to an internal ECU function key
X# representation
X# 
X# The format of an entry is shown below in the 'ansilike' example (used
X# to ansilike ECU from the console by defining an ansi terminal type
X# nevertheless equivalent to ansi).
X# 
X# The first line(s) in a terminal keyboard description begin in
X# column 1 and contain the terminal types (a la $TERM) for which
X# the keyboard description are valid.  The example entry contains
X# several references to terminal types containing the substring
X# 'ansi'.  These are included only as an example of one keyboard
X# description servicing multiple terminal types.
X# 
X# ECU determines whether a terminal meets the ansi vs.  ANSI
X# distinction by searching for 'ansi' in the $TERM environment
X# variable (without regard to case: 'AnSi' will match as well as
X# 'ansi').  If your keyboard matches the ANSI specification even
X# though your $TERM environment variable does not contain 'ansi'
X# (such as 'sun'), then you may add the terminal type to the 'ansilike'
X# entry rather than create a separate entry.
X# 
X# Following the "first lines" are key definition entries, each
X# preceded by at least one tab or space.  Each entry is composed of
X# three fields delimited by commas.  The first field of an entry is
X# the internal ECU function key name and must be chosen from the
X# following strings (with no regard to case): "F1", "F2", "F3",
X# "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12", "Home",
X# "End", "PgUp", "PgDn", "CUP", "CUL", "CU5", "CUR" and "CUD" The
X# second field contains the name of the key as it appears on the
X# non-ANSI keyboard (such as "Send" for End on the Wyse 60).  The
X# third field is a description of the character sequence generated
X# by the non-ANSI keyboard when the chosen key is pressed; it is a
X# string of one or more tokens separated by spaces or tabs.
X# The tokens are described in full in the ECU manual sections titled
X# "Function Key Recognition" and "Function Key Mapping."
X#
X# << LOOK >> NOTE:
X# Compile and run 'kbdtest3.c' (see the source file for information)
X# to build a file containing the emitted sequences for each supported
X# function key.  Looking at the file, you will see it is a nonansikey
X# formatted keyboard description complete with the TERM terminal type.
X# I would appreciate your mailing me any files you
X# create describing non-SCO/non-ISC main console keyboards.
X#
X# If you like, compile the older 'kbdtest.c' module released with 3.0
X# and run it. Press any key you like and hex for the emitted
X# sequence will appear on the screen.  Press ^D to exit the program.
X#
X# Comment the SCO ODT xterm and uncomment the Metro Link xterm entry
X# if you have that system.  See below for xmodmap instructions.
X# 
X#-------------------------------------------------------------------------
X#+:EDITS:
X#:05-06-1991-02:31-wht@n4hgf-add tandem terminal "ansi-terminal"
X#:05-05-1991-17:37-root@n4hgf-add ISC at386 tnx to dug@kd4nc
X#:05-02-1991-04:53-wht@n4hgf-document kbdtest3
X#:03-26-1991-00:00-wht@n4hgf-more Metro Link work
X#:03-19-1991-21:04-root@n4hgf-add Metro Link MetroX X11R4 xterm
X#:12-20-1990-23:50-wht@n4hgf-"correct" wyse entry
X#:12-18-1990-19:43-wht@n4hgf-add xterm and wy60
X#:12-02-1990-13:34-wht@n4hgf-creation
X
X#+-------------------------------------------------------------------
X#   testing/example
X#--------------------------------------------------------------------
Xansilike
Xansi
Xmsdos
Xdos
Xdosansi
Xtest
X    F1:F1:          esc [ M 
X    F2:F2:          esc [ N 
X    F3:F3:          esc [ O 
X    F4:F4:          esc [ P 
X    F5:F5:          esc [ Q 
X    F6:F6:          esc [ R 
X    F7:F7:          esc [ S 
X    F8:F8:          esc [ T 
X    F9:F9:          esc [ U 
X    F10:F10:        esc [ V 
X    F11:F11:        esc [ W 
X    F12:F12:        esc [ X 
X    Home:Home:      esc [ H 
X    End:End:        esc [ F 
X    PgUp:PgUp:      esc [ I 
X    PgDn:PgDn:      esc [ G 
X    CUU:CUU:        esc [ A 
X    CUL:CUL:        esc [ D 
X    CU5:CU5:        esc [ E 
X    CUR:CUR:        esc [ C 
X    CUD:CUD:        esc [ B 
X    Ins:Ins:        esc [ L
X    BkTab:BackTab:  esc [ Z
X
X#+-------------------------------------------------------------------
X#   SCO ODT 1.0/1.1 console xterm (as released, unmodified)
X#--------------------------------------------------------------------
Xxterm
X    F1:F1:          esc [ 1 1 ~
X    F2:F2:          esc [ 1 2 ~
X    F3:F3:          esc [ 1 3 ~
X    F4:F4:          esc [ 1 4 ~
X    F5:F5:          esc [ 1 5 ~
X    F6:F6:          esc [ 1 7 ~
X    F7:F7:          esc [ 1 8 ~
X    F8:F8:          esc [ 1 9 ~
X    F9:F9:          esc [ 2 0 ~
X    F10:F10:        esc [ 2 1 ~
X#   F11:F11:        esc [ 2 3 ~   # decommitted to provide a CU5
X#   F12:F12:        esc [ 2 4 ~   # decommitted to provide a BkTab
X    Home:Home:      esc [ 8 ~
X    End:End:        esc [ 7 ~
X    PgUp:PgUp:      esc [ 5 ~
X    PgDn:PgDn:      esc [ 6 ~
X    CUU:CUU:        esc [ A 
X    CUL:CUL:        esc [ D 
X#   CU5:CU5:        esc [ 8 ~     # same as HOME unfortunately
X    CU5:F11:        esc [ 2 3 ~
X    CUR:CUR:        esc [ C 
X    CUD:CUD:        esc [ B 
X    Ins:Ins:        esc [ 2 ~
X#   BkTab:BackTab:  tab           # same as TAB unfortunately
X    BkTab:F12:      esc [ 2 4 ~
X
X#+-------------------------------------------------------------------
X#   Metro Link X11R4 console xterm (Release 1.2)
X#
X# You need in .xinitrc or whatever
X#    xmodmap -e "keycode 22 = BackSpace"
X# and in .Xdefaults or whatever,
X# XTerm*VT100*Translations: #override\
X#      Shift <Key>Tab:   string(0x1b) string("[90~") \n \
X#      <Key>Begin:       string(0x1b) string("[98~") \n \
X#      <Key>End:         string(0x1b) string("[99~") 
X#
X# Unfortunately, the CU5 key appears to be dead, so I use F12.
X#--------------------------------------------------------------------
X#xterm
X#    BkTab:BkTab:    esc [ 9 0 ~
X#    CU5:CU5:        esc [ 2 4 ~
X#    F1:F1:          esc [ 1 1 ~
X#    F2:F2:          esc [ 1 2 ~
X#    F3:F3:          esc [ 1 3 ~
X#    F4:F4:          esc [ 1 4 ~
X#    F5:F5:          esc [ 1 5 ~
X#    F6:F6:          esc [ 1 7 ~
X#    F7:F7:          esc [ 1 8 ~
X#    F8:F8:          esc [ 1 9 ~
X#    F9:F9:          esc [ 2 0 ~
X#    F10:F10:        esc [ 2 1 ~
X#    F11:F11:        esc [ 2 3 ~
X## F12: used for CU5 replacement
X#    Ins:Ins:        esc [ 2 ~
X#    Home:Home:      esc [ 9 8 ~
X#    End:End:        esc [ 9 9 ~
X#    PgUp:PgUp:      esc [ 5 ~
X#    PgDn:PgDn:      esc [ 6 ~
X#    CUU:CUU:        esc [ A
X#    CUD:CUD:        esc [ B
X#    CUL:CUL:        esc [ D
X#    CUR:CUR:        esc [ C
X
X#+-------------------------------------------------------------------
X#   ISC 'AT386' keyboard
X#--------------------------------------------------------------------
XAT386
Xat386
X    F1:F1:          esc O P 
X    F2:F2:          esc O Q 
X    F3:F3:          esc O R 
X    F4:F4:          esc O S 
X    F5:F5:          esc O T 
X    F6:F6:          esc O U 
X    F7:F7:          esc O V 
X    F8:F8:          esc O W 
X    F9:F9:          esc O X 
X    F10:F10:        esc O Y 
X    F11:F11:        esc O Z 
X    F12:F12:        esc O A 
X    Home:Home:      esc [ H 
X    End:End:        esc [ Y 
X    PgUp:PgUp:      esc [ V 
X    PgDn:PgDn:      esc [ U 
X    CUU:CUU:        esc [ A 
X    CUL:CUL:        esc [ D 
X    CU5:CU5:        esc [ G 
X    CUR:CUR:        esc [ C 
X    CUD:CUD:        esc [ B 
X    Ins:Ins:        esc [ @
X    BkTab:BackTab:  gs
X
X#+-------------------------------------------------------------------
X#    Wyse 60 Native Mode (no reprogrammed function keys)
X#    (matching the keyboard tops I have, anyway)
X#
X# The following is for native mode Wyse 60 with no function keys
X# programmed for emitting alternate sequences.  This is such a
X# nice terminal in so many ways.  Too bad they cocked up the left
X# and down function keys by making them indistinguishable from
X# backspace and newline. You may wish to study the SCO /etc/termcap
X# 'wy60ak' entry for a way around this.
X#
X# Note there is a kludge in the terminal initialization code
X# to force a Wyse 60's *arrow keys* to use ANSI sequences.
X# This entry as shipped counts on this.  If you don't have SCO, try
X# the termcap entry in README.WY60
X#
X# If you really want to avoid this, comment out the IS strings below.
X#--------------------------------------------------------------------
Xwy60
Xwyse60
Xwy60ak
Xwyse60ak
Xwy60-43
Xwyse60-43
Xwyse60ak-43
Xwy60ak-43
X	IS:1:           esc Z 1 + esc [ A del
X	IS:2:			esc Z 1 , esc [ B del
X	IS:3:			esc Z 1 - esc [ D del
X	IS:4:			esc Z 1 . esc [ C del
X	IS:5:			esc Z 1 \ esc [ F del
X	IS:6:			esc Z 1 q esc [ L del 
X    F1:F1:          soh @ cr
X    F2:F1:          soh A cr
X    F3:F1:          soh B cr
X    F4:F1:          soh C cr
X    F5:F1:          soh D cr
X    F6:F1:          soh E cr
X    F7:F1:          soh F cr
X    F8:F1:          soh G cr
X    F9:F1:          soh H cr
X    F10:F10:        soh I cr
X    F11:F11:        soh J cr
X    F12:F12:        soh K cr
X    Home:Home:      rs
X    PgUp:PrevPg:    esc J
X    PgDn:NextPg:    esc K
X    BkTab:F14:      soh M cr
X    Ins:InsChar:    esc Q
X    End:Send:       esc 7
X#comment these out if you DO comment the IS strings
X   CUU:CUU:        esc [ A 
X   CUL:CUL:        esc [ D 
X   CU5:CU5:        esc [ E 
X   CUR:CUR:        esc [ C 
X   CUD:CUD:        esc [ B 
X#   Home:Home:      esc [ H 
X#   End:End:        esc [ F 
X#uncomment the if you DO NOT comment the IS strings
X#    CUU:CUU:        vt
X#    CUR:CUR:        ff
X
X# From: rootk@tdmsou (Admin)
X# Date: Mon, 6 May 91 2:23:56 EDT
X# nonansikey definition for TERM='ansi-tandem'
X# built by kbdtest3.c Mon May  6 02:17:13 1991
Xansi-tandem
X    BkTab:BkTab:    esc [ Z
X    CU5:CU5:        esc [ T
X    F1:F1:          soh @ cr 
X    F2:F2:          soh A cr 
X    F3:F3:          soh B cr 
X    F4:F4:          soh C cr 
X    F5:F5:          soh D cr 
X    F6:F6:          soh E cr 
X    F7:F7:          soh F cr 
X    F8:F8:          soh G cr 
X    F9:F9:          soh H cr 
X    F10:F10:        soh I cr 
X    F11:F11:        soh J cr 
X    F12:F12:        soh K cr 
X    Ins:Ins:        esc [ @
X    Home:Home:      esc [ H
X    End:End:        esc [ 2 4 H
X    PgUp:PgUp:      esc [ V
X    PgDn:PgDn:      esc [ U
X    CUU:CUU:        esc [ A
X    CUD:CUD:        esc [ B
X    CUL:CUL:        esc [ D
X    CUR:CUR:        esc [ C
X
SHAR_EOF
$TOUCH -am 0718072191 'models/nonansikeys' &&
chmod 0644 models/nonansikeys ||
echo 'restore of models/nonansikeys failed'
Wc_c="`wc -c < 'models/nonansikeys'`"
test 10409 -eq "$Wc_c" ||
	echo 'models/nonansikeys: original size 10409, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/oneline.ep ==============
if test -f 'models/oneline.ep' -a X"$1" != X"-c"; then
	echo 'x - skipping models/oneline.ep (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
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 0429171591 'models/oneline.ep' &&
chmod 0644 models/oneline.ep ||
echo 'restore of models/oneline.ep failed'
Wc_c="`wc -c < 'models/oneline.ep'`"
test 877 -eq "$Wc_c" ||
	echo 'models/oneline.ep: original size 877, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/opuslogin.ep ==============
if test -f 'models/opuslogin.ep' -a X"$1" != X"-c"; then
	echo 'x - skipping models/opuslogin.ep (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting models/opuslogin.ep (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'models/opuslogin.ep' &&
X#  CHK=0xE753
X#+-----------------------------------------------------------------
X#  opuslogin.ep - ecu OPUS BBS 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 0429171591 'models/opuslogin.ep' &&
chmod 0644 models/opuslogin.ep ||
echo 'restore of models/opuslogin.ep failed'
Wc_c="`wc -c < 'models/opuslogin.ep'`"
test 2086 -eq "$Wc_c" ||
	echo 'models/opuslogin.ep: original size 2086, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/p.ep ==============
if test -f 'models/p.ep' -a X"$1" != X"-c"; then
	echo 'x - skipping models/p.ep (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
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 0429171591 'models/p.ep' &&
chmod 0644 models/p.ep ||
echo 'restore of models/p.ep failed'
Wc_c="`wc -c < 'models/p.ep'`"
test 1110 -eq "$Wc_c" ||
	echo 'models/p.ep: original size 1110, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/phone ==============
if test -f 'models/phone' -a X"$1" != X"-c"; then
	echo 'x - skipping models/phone (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting models/phone (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'models/phone' &&
X#ECUPHONE
X# when saving this file, ECU will preserve commented lines
X#sco2:1(408)425-3502::2400:N:sosco uucp
Xnavobs:1(202)653-0351::1200:N:Naval Observatory Time
SHAR_EOF
$TOUCH -am 0715135491 'models/phone' &&
chmod 0644 models/phone ||
echo 'restore of models/phone failed'
Wc_c="`wc -c < 'models/phone'`"
test 162 -eq "$Wc_c" ||
	echo 'models/phone: original size 162, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/phrases ==============
if test -f 'models/phrases' -a X"$1" != X"-c"; then
	echo 'x - skipping models/phrases (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
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 0429171591 'models/phrases' &&
chmod 0644 models/phrases ||
echo 'restore of models/phrases failed'
Wc_c="`wc -c < 'models/phrases'`"
test 117 -eq "$Wc_c" ||
	echo 'models/phrases: original size 117, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/ps.ep ==============
if test -f 'models/ps.ep' -a X"$1" != X"-c"; then
	echo 'x - skipping models/ps.ep (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting models/ps.ep (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'models/ps.ep' &&
X#  CHK=0xDA50
X#+------------------------------------------------------
X# ps.eq - another colorful ps example
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,'root') == 0 color yellow
X		echo $s0
X	}
X	icolor $icolor
X	send ''
X
SHAR_EOF
$TOUCH -am 0429171591 'models/ps.ep' &&
chmod 0644 models/ps.ep ||
echo 'restore of models/ps.ep failed'
Wc_c="`wc -c < 'models/ps.ep'`"
test 895 -eq "$Wc_c" ||
	echo 'models/ps.ep: original size 895, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/put_ecu.ep ==============
if test -f 'models/put_ecu.ep' -a X"$1" != X"-c"; then
	echo 'x - skipping models/put_ecu.ep (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
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 0429171591 'models/put_ecu.ep' &&
chmod 0644 models/put_ecu.ep ||
echo 'restore of models/put_ecu.ep failed'
Wc_c="`wc -c < 'models/put_ecu.ep'`"
test 1963 -eq "$Wc_c" ||
	echo 'models/put_ecu.ep: original size 1963, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/ringcount.ep ==============
if test -f 'models/ringcount.ep' -a X"$1" != X"-c"; then
	echo 'x - skipping models/ringcount.ep (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting models/ringcount.ep (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'models/ringcount.ep' &&
X#+----------------------------------------------------------------
X# ringcount.ep - ESIO Ring Indicator Test
X# only useful for versions compiled for and using ESIO tty driver
X#-----------------------------------------------------------------
X
X	$i_initial_RI = %ridet	# initial number of rings
X
X	send 'aaaaaaaats0=0'
X	lookfor -e %chr(0x01) 30
X
X	whilei 1==1
X	{
X		echo -n 'RI= '+%itos(%ridet,5d)+'  MSR='+%msrtext
X		eeol
X		echo -n '\r'
X		nap -m 100
X	}
SHAR_EOF
$TOUCH -am 0429171591 'models/ringcount.ep' &&
chmod 0644 models/ringcount.ep ||
echo 'restore of models/ringcount.ep failed'
Wc_c="`wc -c < 'models/ringcount.ep'`"
test 449 -eq "$Wc_c" ||
	echo 'models/ringcount.ep: original size 449, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/root.ep ==============
if test -f 'models/root.ep' -a X"$1" != X"-c"; then
	echo 'x - skipping models/root.ep (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting models/root.ep (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'models/root.ep' &&
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 0429171591 'models/root.ep' &&
chmod 0644 models/root.ep ||
echo 'restore of models/root.ep failed'
Wc_c="`wc -c < 'models/root.ep'`"
test 503 -eq "$Wc_c" ||
	echo 'models/root.ep: original size 503, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/rz_update.ep ==============
if test -f 'models/rz_update.ep' -a X"$1" != X"-c"; then
	echo 'x - skipping models/rz_update.ep (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
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 0429171591 'models/rz_update.ep' &&
chmod 0644 models/rz_update.ep ||
echo 'restore of models/rz_update.ep failed'
Wc_c="`wc -c < 'models/rz_update.ep'`"
test 4983 -eq "$Wc_c" ||
	echo 'models/rz_update.ep: original size 4983, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/scm.ep ==============
if test -f 'models/scm.ep' -a X"$1" != X"-c"; then
	echo 'x - skipping models/scm.ep (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting models/scm.ep (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'models/scm.ep' &&
X#  CHK=0x01CA
X#+------------------------------------------------------------
X# scm.ep - goto scm and use wht .cshrc
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-26-1989-19:25-wht-working with su.ep - no longer secret
X
X	mkvar icsave; $icsave = %colors
X	do 'su' 'scm' 'secret'
X	lookfor '% ' 70		# swallow prompt left by su.ep
X	color gray
X	send 'source ~wht/.cshrc'
X	lookfor -e '\n' 70
X	ifs %argv(1) != '.'
X	{
X		lookfor '% ' 70		# swallow prompt
X		send 'cd'
X		lookfor -e '\n' 50	# send 'cd', swallow echo
X	}
X	icolor $icsave
SHAR_EOF
$TOUCH -am 0429171591 'models/scm.ep' &&
chmod 0644 models/scm.ep ||
echo 'restore of models/scm.ep failed'
Wc_c="`wc -c < 'models/scm.ep'`"
test 643 -eq "$Wc_c" ||
	echo 'models/scm.ep: original size 643, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/senddate.ep ==============
if test -f 'models/senddate.ep' -a X"$1" != X"-c"; then
	echo 'x - skipping models/senddate.ep (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
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 0429171591 'models/senddate.ep' &&
chmod 0644 models/senddate.ep ||
echo 'restore of models/senddate.ep failed'
Wc_c="`wc -c < 'models/senddate.ep'`"
test 557 -eq "$Wc_c" ||
	echo 'models/senddate.ep: original size 557, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/sf_test.ep ==============
if test -f 'models/sf_test.ep' -a X"$1" != X"-c"; then
	echo 'x - skipping models/sf_test.ep (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting models/sf_test.ep (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'models/sf_test.ep' &&
X#--------------------------------------------------------------------
X# sf_test.ep - test various string functions
X#
X#Sample execution:
X#% ecu -p sf_test
X#
X# ecu x3.00.05.00-386u by wht@n4hgf (pid 5890)
X# 
X# procedure is sf_test run on Mon 08-13-1990 at 15:39:17 (19:39 UTC)
X# username is "wht"
X# current directory is "/u1/src/ecu/models"
X# 
X# %instr('abcdefabcdefghi','def') = 3
X# %rinstr('abcdefabcdefghi','def') = 9
X# 
X# %basename('/u1/src/src/foo.c','.c') = "/u1/src/src/foo"
X# %basename('foo.c','.c') = "foo"
X# %basename('foo.c','.x') = "foo.c"
X# 
X# %dirpart('/u1/src/src/foo.c') = "/u1/src/src"
X# %dirpart('foo.c') = "foo.c"
X# %dirpart('/usr') = ""
X# 
X# %filepart('/u1/src/src/foo.c') = "foo.c"
X# %filepart('foo.c') = "foo.c"
X# 
X# %envvar('HZ') = "100"
X# %envvar('HOME') = "/u9/wht"
X# %envvar('FOOBARTZHUMMER') = ""
X# 
X# errno 1 = "Not owner"
X# 5678 seconds is "01:34:38"
X# mode 105755 is "-rwsr-xr-t"
X# [procedure finished]
X# 
X# 
X# [no line attached by initial procedure]
X# [press ESC to exit or SPACE for setup menu]
X# 
X#--------------------------------------------------------------------
X
X	echo ''
X	echo -n 'procedure is '+%argv(0)+' run on '+%day+' '+%date
X	echo ' at '+%times+' ('+%timez+' UTC)'
X	echo 'username is "'+%logname+'"'
X	echo 'current directory is "'+%dir+'"'
X
X	echo ''
X	echo -n '%instr(\'abcdefabcdefghi\',\'def\') = '
X	echo %itos(%instr('abcdefabcdefghi','def'))
X
X	echo -n '%rinstr(\'abcdefabcdefghi\',\'def\') = '
X	echo %itos(%rinstr('abcdefabcdefghi','def'))
X
X	echo ''
X	echo -n '%basename(\'/u1/src/src/foo.c\',\'.c\') = '
X	echo '"'+%basename('/u1/src/src/foo.c','.c')+'"'
X
X	echo -n '%basename(\'foo.c\',\'.c\') = '
X	echo '"'+%basename('foo.c','.c')+'"'
X
X	echo -n '%basename(\'foo.c\',\'.x\') = '
X	echo '"'+%basename('foo.c','.x')+'"'
X
X	echo ''
X	echo -n '%dirpart(\'/u1/src/src/foo.c\') = '
X	echo '"'+%dirpart('/u1/src/src/foo.c')+'"'
X
X	echo -n '%dirpart(\'foo.c\') = '
X	echo '"'+%dirpart('foo.c')+'"'
X
X	echo -n '%dirpart(\'/usr\') = '
X	echo '"'+%dirpart('/usr')+'"'
X
X	echo ''
X	echo -n '%filepart(\'/u1/src/src/foo.c\') = '
X	echo '"'+%filepart('/u1/src/src/foo.c')+'"'
X
X	echo -n '%filepart(\'foo.c\') = '
X	echo '"'+%filepart('/u1/src/src/foo.c')+'"'
X
X	echo ''
X	echo '%envvar(\'HZ\') = "'+%envvar('HZ')+'"'
X	echo '%envvar(\'HOME\') = "'+%envvar('HOME')+'"'
X	echo '%envvar(\'FOOBARTZHUMMER\') = "'+%envvar('FOOBARTZHUMMER')+'"'
X
X	echo ''
X	echo 'errno 1 = "'+%errstr(1)+'"'
X	echo '5678 seconds is "'+%etime(5678)+'"'
X	echo 'mode 105755 is "'+%fmodestr(0o105755)+'"'
SHAR_EOF
$TOUCH -am 0429171591 'models/sf_test.ep' &&
chmod 0644 models/sf_test.ep ||
echo 'restore of models/sf_test.ep failed'
Wc_c="`wc -c < 'models/sf_test.ep'`"
test 2490 -eq "$Wc_c" ||
	echo 'models/sf_test.ep: original size 2490, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/su.ep ==============
if test -f 'models/su.ep' -a X"$1" != X"-c"; then
	echo 'x - skipping models/su.ep (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
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 0429171591 'models/su.ep' &&
chmod 0644 models/su.ep ||
echo 'restore of models/su.ep failed'
Wc_c="`wc -c < 'models/su.ep'`"
test 1465 -eq "$Wc_c" ||
	echo 'models/su.ep: original size 1465, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/sysname.ep ==============
if test -f 'models/sysname.ep' -a X"$1" != X"-c"; then
	echo 'x - skipping models/sysname.ep (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting models/sysname.ep (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'models/sysname.ep' &&
X#-----------------------------------------------------------
X# sysname.ep - procedure to call UNIX-like system 'sysname'
X#
X# CONFIDENTIAL - This function should be chmod 0600 because
X# it contains a password which you probably don't want to be
X# common knowledge.
X#
X# This procedure calls 'unixlogin.ep' to do the hard work.
X#-----------------------------------------------------------
X
X    mkvar $s_pwd(20)    # local variable preserves password
X    $s_pwd = 'password' # security by disappearing when the
X                        # procedure terminates
X
X#   also, by keeping the password text off the following line,
X#   the password will not be displayed if you abort (interrupt)
X#   the procedure
X
X    do 'unixlogin' %argv(0) 'username' $s_pwd 'ansi-or-whatever'
SHAR_EOF
$TOUCH -am 0429171591 'models/sysname.ep' &&
chmod 0644 models/sysname.ep ||
echo 'restore of models/sysname.ep failed'
Wc_c="`wc -c < 'models/sysname.ep'`"
test 766 -eq "$Wc_c" ||
	echo 'models/sysname.ep: original size 766, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= models/sz_update.ep ==============
if test -f 'models/sz_update.ep' -a X"$1" != X"-c"; then
	echo 'x - skipping models/sz_update.ep (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting models/sz_update.ep (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'models/sz_update.ep' &&
X#  CHK=0x4068
X#--------------------------------------------------------------
X# sz_update.ep - update local directory
X#
X# parameters:
X# %argv(1) = remote directory to copy to
X# %argv(2) = local directory to copy from
X# %argv(3) = file list to send
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#:05-21-1991-20:14-wht@n4hgf-was reporting skipped files as failed transfer
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_suflag			# true if su occurred
X	mkvar $i_rtnflag		# return code
X	mkvar $s_origdir(128)	# original working directory
X	mkvar $s_ruser(16)		# remote username we started with before su
X	mkvar $s_rdir(128)		# remote directory we started with
X	mkvar $s_xtitle(64)		# title for xfer
X
X	$i_csave=%colors # get colors at entry
X
X	$s0=%argv(0)+' '+%argv(5)+' '+%rname+' '+%argv(1)
X	logevent $s0
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    %argv(1)
X
X# transfer files
X	color lt_blue
X	echo 'sz -n -f '+%argv(3)
X	icolor $i_csave				# restore colors at entry
X	sz -nfl $s_xtitle '-w 16384 '+%argv(3)
X	ifi $i0 > 127				# 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	else ifi $i0 > 0
X	{
X		color yellow; echo %itos($i0)+' files skipped'
X	}
X	lookfor '% ' 50				# swallow prompt
X	goto RETURN
X
XSORRY # whoops
X	color red;echo 'sz_update failed ... sorry'
X	$i_rtnflag = 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
SHAR_EOF
true || echo 'restore of models/sz_update.ep failed'
fi
echo 'End of ecu310 part 36'
echo 'File models/sz_update.ep is continued in part 37'
echo 37 > _shar_seq_.tmp
exit 0
--------------------------------------------------------------------
Warren Tucker, TuckerWare emory!n4hgf!wht or wht@n4hgf.Mt-Park.GA.US
Hacker Extraordinaire  d' async PADs,  pods,  proteins and protocols

exit 0 # Just in case...
-- 
Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
Sterling Software, IMD           UUCP:     uunet!sparky!kent
Phone:    (402) 291-8300         FAX:      (402) 291-4362
Please send comp.sources.misc-related mail to kent@uunet.uu.net.


