home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume12 / ecu2.80 / part28 < prev    next >
Encoding:
Text File  |  1990-05-11  |  54.1 KB  |  2,063 lines

  1. Newsgroups: comp.sources.misc
  2. subject: v12i081: ECU 2.80 part 28/29
  3. from: wht%n4hgf@gatech.edu (Warren Tucker)
  4. Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  5.  
  6. Posting-number: Volume 12, Issue 81
  7. Submitted-by: wht%n4hgf@gatech.edu (Warren Tucker)
  8. Archive-name: ecu2.80/part28
  9.  
  10. ---- Cut Here and unpack ----
  11. #!/bin/sh
  12. # This is part 28 of ecu280
  13. if touch 2>&1 | fgrep '[-amc]' > /dev/null
  14.  then TOUCH=touch
  15.  else TOUCH=true
  16. fi
  17. # ============= doc/_p_param.txt ==============
  18. echo "x - extracting doc/_p_param.txt (Text)"
  19. sed 's/^X//' << 'SHAR_EOF' > doc/_p_param.txt &&
  20. X.*s 2 "Arguments"
  21. X
  22. XThere are five types of arguments to procedure commands:
  23. X.DS I
  24. XSwitch
  25. XAlphabetic Token
  26. XInteger
  27. XString
  28. XRelational Operators
  29. X.DE
  30. XThis section describes the syntax and construction of each type in turn.
  31. XThere are separate groups of valid of relational operators for integers
  32. Xand strings; thus, they are described under the appropriate sections.
  33. X
  34. X.*s 3 "Switches"
  35. X
  36. XSwitch arguments begin with a hyphen (minus, '-').  The switch
  37. Xargument must be the first argument after the command.  Only
  38. Xone switch argument is allowed on the command line.  If
  39. Xswitches '-a', '-b' and '-c', are available and '-a' and '-b'
  40. Xare desired, '-ab' or '-ba' is entered.
  41. X
  42. X.*s 3 "Alphabetic Tokens"
  43. X
  44. XAlphabetic tokens, for lack of a better term, are non-integer,
  45. Xnon-quoted terms used as arguments for certain commands, such as:
  46. X.DS I
  47. Xplog off
  48. X.DE
  49. XSuch argument types are fairly simple to understand and use; they are
  50. Xdescribed here for completeness.
  51. X
  52. X.*s 3 "Integers"
  53. X
  54. XInteger values are 32-bit quantities ranging between -2147483647
  55. Xand 2147483647.
  56. X
  57. XIn one case, an integer is used to store a 32-bit color mask as
  58. Xdescribed by the
  59. X.B color
  60. Xcommand and the
  61. X.B %colors
  62. Xinteger function.
  63. X
  64. X.*s 4 "Constants"
  65. X
  66. XInteger constants are numeric strings, optionally with an initial
  67. Xminus sign, the absolue value of which must be less than 2147483648.
  68. X
  69. X.*s 4 "Variables"
  70. X
  71. XThere are 50 numbered, permanent integer variables referenced by
  72. Xthe terms '$i0' through '$i49'.  When ECU is started, the value of each
  73. Xvariable is zero.  Variables retain their
  74. Xvalue until changed, even between procedure executions.
  75. XThe integer variable number may be expressed
  76. Xas an expression by enclosing an integer expression in brackets.
  77. XFor instance:
  78. X.DS L
  79. X     $i[4+5]      refers to $i9
  80. X
  81. X     $i2=5
  82. X     $i[20+$i2]   refers to $i25
  83. X.DE
  84. X
  85. XInteger variables may be created for use as "local" variables or
  86. Xto promote code readability.  Refer to the
  87. X.B mkvar
  88. Xcommand.
  89. X
  90. X.*s 4 "Functions"
  91. X
  92. XECU has many built-in functions which return the value of ecu- or
  93. Xsystem-related information.  A list of the functions appears in a
  94. Xlater section.
  95. X
  96. X.*s 4 "Expressions"
  97. X
  98. XIn almost any place an integer argument is allowed, an expression
  99. Xmay be supplied.  Expressions are composed of two or more integer
  100. Xconstants or variables separated by operators from the group:
  101. X.DS L
  102. X    +     addition
  103. X    -     subtraction
  104. X    *     multiplication
  105. X    /     division
  106. X    |     OR
  107. X    @     MOD
  108. X    ^     XOR
  109. X    &     AND
  110. X.DE
  111. XEvaluation of expressions is left-to-right.  Parentheses are
  112. Xnot allowed.
  113. X
  114. X.*s 4 "Relational Operators"
  115. X
  116. XInteger relational operators are chosen from the following group:
  117. X.DS L
  118. X     =       "is equal to"
  119. X     ==      "is equal to"
  120. X     !=      "is not equal to"
  121. X     <>      "is not equal to"
  122. X     >       "is greater than"
  123. X     <       "is greater than"
  124. X     >=      "is greater than or equal to"
  125. X     <=      "is less than or equal to"
  126. X.DE
  127. X
  128. X.*s 3 "Strings"
  129. X
  130. XStrings are classic concatenations of zero or more eight-bit
  131. Xcharacters.  In general, the maximum size of a string used by
  132. XECU is 256 characters.
  133. X
  134. X.*s 4 "Constants"
  135. X
  136. XString constants are formed by placing alphanumeric characters
  137. Xbetween single quote characters (apostrophes).  The backslash ('\\')
  138. Xcharacter is used to "escape" certains characters:
  139. X.DS L
  140. X    '\\\\'    one backslash
  141. X    '\\n'   newline
  142. X    '\\t'   tab
  143. X    '\\''   apostrophe
  144. X.DE
  145. X
  146. X.*s 4 "Variables"
  147. X
  148. XThere are 50 numbered, permanent string variables referenced by
  149. Xthe terms '$s0' through '$s49',
  150. Xeach possessing a maximum length of 256 characters
  151. XWhen ECU is started, the value of each
  152. Xvariable is null (zero length).  Variables retain their
  153. Xvalue until changed, even between procedure executions.
  154. XThe string variable number may be expressed
  155. Xas an expression by enclosing an string expression in brackets.
  156. XFor instance:
  157. X.DS L
  158. X     $s[4+5]      refers to $s9
  159. X
  160. X     $s2=5
  161. X     $s[20+$s2]   refers to $s25
  162. X.DE
  163. X
  164. XString variables may be created for use as "local" variables or
  165. Xto promote code readability.  Refer to the
  166. X.B mkvar
  167. Xcommand.
  168. X
  169. X.*s 4 "Functions"
  170. X
  171. XECU has many built-in functions which return the value of ecu- or
  172. Xsystem-related information.  A list of the functions appears in a
  173. Xlater section.
  174. X
  175. X.*s 4 "Expressions"
  176. X
  177. XString expressions are formed by the concatenation of string
  178. Xconstants, variables and function return values using the '+'
  179. Xoperator:
  180. X.DS L
  181. XExample:
  182. X   'The quick brown fox jumped over the '+$s0'+' dog at '+%time
  183. X.DE
  184. X
  185. X.*s 4 "Relational Operators"
  186. X
  187. XString relational operators are chosen from the following group:
  188. X.DS L
  189. X     =       "is equal to"
  190. X     ==      "is equal to"
  191. X     !=      "is not equal to"
  192. X     <>      "is not equal to"
  193. X.DE
  194. X
  195. SHAR_EOF
  196. $TOUCH -am 0414232090 doc/_p_param.txt &&
  197. chmod 0644 doc/_p_param.txt ||
  198. echo "restore of doc/_p_param.txt failed"
  199. set `wc -c doc/_p_param.txt`;Wc_c=$1
  200. if test "$Wc_c" != "4645"; then
  201.     echo original size 4645, current size $Wc_c
  202. fi
  203. # ============= doc/_p_sfunc.txt ==============
  204. echo "x - extracting doc/_p_sfunc.txt (Text)"
  205. sed 's/^X//' << 'SHAR_EOF' > doc/_p_sfunc.txt &&
  206. X.*s 2 "String Functions"
  207. X
  208. X.*s 3 "%argv"
  209. X
  210. Xusage: %argv(int0)
  211. X
  212. XThis function returns the string value of an argument passed
  213. Xto the procedure by the 'do' command.  Argument 0 is the
  214. Xname of the procedure itself.
  215. XThe integer function %argc may be used to determine the
  216. Xnumber of arguments passed to the procedure.  Specifying
  217. Xan argument number greater than the number of arguments
  218. Xpassed returns a null string (if procedure tracing is enabled
  219. Xwith the 'ptrace' comand, a warning will be displayed
  220. Xin this case).
  221. X.DS I
  222. XExample:
  223. X    invocation from shell:
  224. X    ecu -p test Quick Brown Fox
  225. X
  226. X    invocation from interactive command line:
  227. X    do test Quick Brown Fox
  228. X
  229. X    invocation from procedure:
  230. X    do 'test' 'Quick' 'Brown' 'Fox'
  231. X    
  232. X    results in:
  233. X    %argv(0) = 'test'
  234. X    %argv(1) = 'Quick'
  235. X    %argv(2) = 'Brown'
  236. X    %argv(3) = 'Fox'
  237. X    %argv(4) = ''
  238. X.DE
  239. X
  240. X.B NOTE:
  241. Xthe interactive
  242. X.B dial
  243. Xcommand, the dialing directory menu and the initial setup menu
  244. Xall can automatically execute a procedure which matches
  245. Xa dialed
  246. X.B
  247. Xlogical telephone number.
  248. X.R
  249. XThere two arguments passed to these procedures, %argv(0) being
  250. Xthe procedure name as always.  %argv(1) is set according to the following
  251. Xtable:
  252. X.DS I
  253. X invoker              %argv(1)
  254. X-------------------  -------------
  255. Xinitial setup menu   !INITIAL
  256. Xinteractive dial     !INTERACTIVE
  257. Xdialing menu         !MENU
  258. X.DE
  259. XThus it is possible for the invoked procedure
  260. Xto determine that it has been automatically executed
  261. Xby testing %argv(1) for an exclamation point, or possibly
  262. Xthe entire argument.
  263. X
  264. X.*s 3 "%cgetc"
  265. X
  266. Xusage: %cgetc
  267. X
  268. XThis  function reads one character from the console keyboard
  269. Xand returns it.  The character is not echoed.
  270. X
  271. X.*s 3 "%cgets"
  272. X
  273. Xusage: %cgets
  274. X
  275. XThis function reads a string from the console keyboard
  276. Xand returns it.  Each character is echoed as it is typed
  277. Xand the user's normal erase and kill character is available
  278. Xto edit the input before terminating the read with ENTER.
  279. X
  280. X.*s 3 "%chr"
  281. X
  282. Xusage: %chr(int0)
  283. X
  284. XThis function returns the character value whose ASCII value
  285. Xis supplied in int0.
  286. X
  287. X.DS L
  288. XExample:
  289. X
  290. X    set $s0 = %chr(4)  places a ^D (EOT) character into $s0
  291. X.DE
  292. X
  293. X.*s 3 "%date"
  294. X
  295. Xusage: %date
  296. X
  297. XThis function returns the current date in the form 'mm-dd-yyyy'
  298. Xin the local time zone (daylight time if it applies).
  299. X
  300. X.*s 3 "%datez"
  301. X
  302. Xusage: %datez
  303. X
  304. XThis function returns the current date in the form 'mm-dd-yyyy'
  305. Xin the UTC (Z) time zone.
  306. X
  307. X.*s 3 "%day"
  308. X
  309. Xusage: %day
  310. X
  311. XThis function returns the current day of the week as a three character
  312. Xabbreviation: 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'
  313. Xin the local time zone (daylight time if it applies).
  314. X
  315. X.*s 3 "%dayz"
  316. X
  317. Xusage: %dayz
  318. X
  319. XThis function returns the current day of the week as a three character
  320. Xabbreviation: 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'
  321. Xin the UTC (Z) time zone.
  322. X
  323. X.*s 3 "%dir"
  324. X
  325. Xusage: %dir
  326. X
  327. XThis function returns the
  328. Xfull pathname of the current working directory.
  329. X
  330. X.*s 3 "%edate"
  331. X
  332. Xusage: %edate(int0)
  333. X
  334. XThe value in int0 is expected to be a number of seconds since January 1,
  335. X1970 00:00 UTC (Universal Coordinated Time) as returned by
  336. Xthe integer functions %fatime and %fmtime.
  337. XThis function converts the value into a string representing the
  338. Xequivalent local time in the form 'mm-dd-yyyy hh:mm:ss'.
  339. X.DS L
  340. XExample:
  341. X
  342. Xset $i0=%fmtime('/xenix')
  343. X$i00 = 601178971 (0x23d5435b,04365241533)
  344. X
  345. Xset $s0=%edate($i0)
  346. X$s00 = '01-18-1989 21:09:31'
  347. X.DE
  348. X
  349. X.*s 3 "%envvar"
  350. X
  351. Xusage: %envvar()
  352. X
  353. XThis function returns the string value of an environment
  354. Xvariable.
  355. X
  356. X.DS L
  357. XExample:
  358. X
  359. X    set $s0=%envvar('HOME') might set $s0 '/usr/user'
  360. X.DE
  361. X.DF L
  362. XTypical Environment Variables:
  363. X
  364. X    HOME          pathname of home directory
  365. X    EDITOR        user's preferred editor
  366. X    PATH          program execution searchlist
  367. X    TERM          terminal type
  368. X    SHELL         user's preferred shell
  369. X    MAIL          user's mail box file
  370. X    ECUPROMPT     ECU interactive command prompt
  371. X                  at beginning of execution
  372. X.DE
  373. X
  374. X.*s 3 "%errstr"
  375. X
  376. Xusage: %errstr(int0)
  377. X
  378. XThis function returns the system error message, given int0 as an
  379. X.B errno
  380. Xas returned by a file-related command.
  381. X.B fopen.
  382. X
  383. X.DS L
  384. XExample:
  385. X
  386. X    echo %errstr(1)
  387. X    Not owner
  388. X.DE
  389. X
  390. X.*s 3 "%etime"
  391. X
  392. Xusage: %etime(int0)
  393. X
  394. XThis function returns a string representation of elapsed time
  395. Xin the format 'hh:mm:ss'
  396. Xfor the integer parameter int0, a number of seconds.
  397. X
  398. X.DS L
  399. XExample:
  400. X
  401. X    echo %etime(62)
  402. X    00:01:02
  403. X.DE
  404. X
  405. X.*s 3 "%fmodestr"
  406. X
  407. Xusage: %fmodestr(int0)
  408. X
  409. XThis function returns a string representation of the
  410. Xfamiliar file mode string given the file mode integer int0.
  411. X
  412. X.DS L
  413. XExample:
  414. X
  415. X    echo %fmodestr(0100755)
  416. X    -rwxr-xr-x
  417. X
  418. X    echo %fmodestr(%fmode('/usr/lib'))
  419. X    drwxr-xr-x
  420. X.DE
  421. X
  422. X.*s 3 "%itos"
  423. X
  424. Xusage: %itos(int0[,format])
  425. X
  426. XThis function converts integer int0 to a string, optionally
  427. Xcontrolling the format of the conversion.
  428. X
  429. XIf the format parameter is missing, the conversion is to
  430. Xa minimum number of decimal characters necessary to
  431. Xhold the result.
  432. X
  433. XIf the format parameter is present, it must of consist of
  434. Xa non-null string made of one or both optional parts:
  435. X.DS L
  436. X    decimal number of digits to be part of result string
  437. X    (a leading zero indicates leading zeroes are to
  438. X    appear in the string; no leading zero pads with
  439. X    leading spaces
  440. X
  441. X    a lower case letter from the following list:
  442. X        d - decimal conversion
  443. X        x - hexadecimal conversion
  444. X        o - octal conversion
  445. X.DE
  446. X.DS L
  447. XExample:
  448. X
  449. X    %itos(33)           '33'
  450. X    %itos(33,d)         '33'
  451. X    %itos(33,x)         '21'
  452. X    %itos(33,5d)        '   33'
  453. X    %itos(33,010d)      '0000000033'
  454. X    %itos(33,10d)       '        33'
  455. X    %itos(33,x)         '21'
  456. X    %itos(33,04x)       '0021'
  457. X    %itos(33,4x)        '  21'
  458. X    %itos(33,o)         '41'
  459. X    %itos(33,4o)        '    41'
  460. X.DE
  461. X
  462. X.*s 3 "%left"
  463. X
  464. Xusage: %left(str0,int0)
  465. X
  466. XThis function returns the leftmost int0 characters of str0.
  467. XIf the length of the string is less than int0,
  468. Xthe entire str0 is returned.
  469. X.DS L
  470. XExample:
  471. X
  472. X    if $s0 == 'abcdefg'
  473. X    %left($s0,3) returns 'abc'
  474. X.DE
  475. X
  476. X.*s 3 "%line"
  477. X
  478. Xusage: %line
  479. X
  480. XThis function returns the name of the attached communications
  481. Xline in the form "/dev/ttyxx".  If no line is currently
  482. Xattached, the function returns null.
  483. X
  484. X.*s 3 "%logname"
  485. X
  486. Xusage: %logname
  487. X
  488. XThis function returns the login name of the user executing
  489. XECU.  Note: the name returned is the name supplied to a login
  490. Xprompt, not any current su(C) username that may be in effect.
  491. X
  492. X.*s 3 "%mid"
  493. X
  494. Xusage: %mid(str0,int0[,int1])
  495. X
  496. XThis function returns the middle portion of a string str0
  497. Xbeginning with the character at position int0 and for a length
  498. Xof int1 characters.
  499. XIf int0 is greater than or equal to the length of
  500. Xstro, a null string is returned.
  501. XIf the optional argument int1 is not supplied, or
  502. Xif the length of the string is less than int1,
  503. Xthe entire str0 is returned.
  504. X.DS L
  505. XExample:
  506. X
  507. X    if $s0 == '0123456789abc'
  508. X    %mid($s0,3,4)  returns '3456'
  509. X    %mid($s0,3)    returns '3456789abc'
  510. X    %mid($s0,10,2) returns 'ab'
  511. X    %mid($s0,10,5) returns 'abc'
  512. X.DE
  513. X
  514. X.*s 3 "%month"
  515. X
  516. Xusage: %month
  517. X
  518. XThis function returns the current month as a three character
  519. Xabbreviation: 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'.
  520. X
  521. X.*s 3 "%rdesc"
  522. X
  523. Xusage: %rdesc
  524. X
  525. XThis function returns the
  526. Xdescription
  527. Xportion of the
  528. Xdialing directory entry for the currently connected remote.
  529. XIf no connection exists, the function returns null.
  530. X
  531. X.*s 3 "%right"
  532. X
  533. Xusage: %right(str0,int0)
  534. X
  535. XThis function returns the rightmost int0 characters of str0.
  536. XIf the length of the string is less than int0,
  537. Xthe entire str0 is returned.
  538. X.DS L
  539. XExample:
  540. X
  541. X    if $s0 == 'abcdefg'
  542. X    %right($s0,3) returns 'efg'
  543. X.DE
  544. X
  545. X.*s 3 "%rname"
  546. X
  547. Xusage: %rname
  548. X
  549. XThis function returns the
  550. Xlogical name
  551. Xportion of the
  552. Xdialing directory entry for the currently connected remote.
  553. XIf the remote was dialed directly, as in dial 5551212, the
  554. Xreturned value is the phone number.
  555. XIf no connection exists, the function returns null.
  556. X
  557. XThe value returned by this command may be overridden by use of the
  558. X.B rname
  559. Xprocedure command.
  560. X
  561. X.*s 3 "%rtelno"
  562. Xusage: %rtelno
  563. X
  564. XThis function returns the
  565. Xtelephone number
  566. Xportion of the
  567. Xdialing directory entry for the currently connected remote.
  568. XIf no connection exists, the function returns null.
  569. X
  570. X.*s 3 "%time"
  571. X
  572. Xusage: %time
  573. X
  574. XThis function returns the current time in the form 'hh:mm'
  575. Xin the local time zone (daylight time if it applies).
  576. X
  577. X.*s 3 "%times"
  578. X
  579. Xusage: %times
  580. X
  581. XThis function returns the current time in the form 'hh:mm:ss'
  582. Xin the local time zone (daylight time if it applies).
  583. X
  584. X.*s 3 "%timez"
  585. X
  586. Xusage: %timez
  587. X
  588. XThis function returns the current time in the form 'hh:mm'
  589. Xin the UTC (Z) time zone.
  590. X
  591. X.*s 3 "%timezs"
  592. X
  593. Xusage: %timezs
  594. X
  595. XThis function returns the current time in the form 'hh:mm:ss'
  596. Xin the UTC (Z) time zone.
  597. X
  598. X.*s 3 "%tty"
  599. X
  600. Xusage: %tty
  601. X
  602. XThis function returns the console tty name in the form "/dev/ttynn".
  603. X
  604. SHAR_EOF
  605. $TOUCH -am 0405140790 doc/_p_sfunc.txt &&
  606. chmod 0644 doc/_p_sfunc.txt ||
  607. echo "restore of doc/_p_sfunc.txt failed"
  608. set `wc -c doc/_p_sfunc.txt`;Wc_c=$1
  609. if test "$Wc_c" != "8864"; then
  610.     echo original size 8864, current size $Wc_c
  611. fi
  612. # ============= doc/_proc.txt ==============
  613. echo "x - extracting doc/_proc.txt (Text)"
  614. sed 's/^X//' << 'SHAR_EOF' > doc/_proc.txt &&
  615. X.*s 1 "Procedure Language"
  616. X
  617. XSample procedures are shown in the companion document 'samplproc.man'.
  618. X
  619. X
  620. X.so _p_param.txt
  621. X
  622. X.so _p_cmd.txt
  623. X
  624. X.so _p_ifunc.txt
  625. X
  626. X.so _p_sfunc.txt
  627. X
  628. SHAR_EOF
  629. $TOUCH -am 0711174289 doc/_proc.txt &&
  630. chmod 0644 doc/_proc.txt ||
  631. echo "restore of doc/_proc.txt failed"
  632. set `wc -c doc/_proc.txt`;Wc_c=$1
  633. if test "$Wc_c" != "171"; then
  634.     echo original size 171, current size $Wc_c
  635. fi
  636. # ============= doc/_startup.txt ==============
  637. echo "x - extracting doc/_startup.txt (Text)"
  638. sed 's/^X//' << 'SHAR_EOF' > doc/_startup.txt &&
  639. X.*s 1 "Starting the Program"
  640. X
  641. X.*s 2 "Simple Startup - Initial Setup Menu"
  642. X
  643. XECU may be started in a number of ways through use of
  644. Xcommand line switches, but the easiest is to enter
  645. X.DS I
  646. Xecu
  647. X.DE
  648. Xby itself.
  649. XIn this case, the screen is cleared
  650. Xand the folowing screen will be presented.
  651. X
  652. X
  653. X.DS L
  654. X
  655. X  .--[ ecu 1.96 Copyright 1986,1989, W. Tucker ]-----------------.
  656. X  |                                                              |
  657. X  |  Name/phone number to call: ___________________              |
  658. X  |                                                              |
  659. X  |                                                              |
  660. X  |  tty: /dev/tty1a                                             |
  661. X  |                                                              |
  662. X  |  duplex: F  baud: 2400   parity:N  (data bits 8)             |
  663. X  |  Add NL to transmitted CR: N                                 |
  664. X  |  Add NL to received CR:    N                                 |
  665. X  |                                                              |
  666. X  |                                                              |
  667. X  |   TAB:next ^B:prev END:proceed ^D:phone dir  ESC:quit ecu    |
  668. X  `- logical phone directory entry, phone number or empty -------'
  669. X
  670. X
  671. X.DE
  672. X
  673. X.*s 3 "Name/Phone Number Field"
  674. X
  675. XIf a dialing directory has been configured,
  676. Xa literal phone number need not be entered.
  677. XHowever, on your first invocation,  you'll very likely have
  678. Xno directory.  Therefore, you have three options:
  679. X
  680. X.DS I
  681. X1.  Enter a literal telephone number, (e.g. 18005551212).
  682. X    Hyphens and open and close parentheses may also
  683. X    be entered.
  684. X
  685. X2.  Press ENTER to skip the 'Name/phone' field and enter
  686. X    ^D to enter the telephone directory to enter your
  687. X    first directory entry.
  688. X
  689. X3.  Press END to enter interactive mode and use the Dial
  690. X    interactive command to dial a literal telephone num-
  691. X    ber or to enter the dialing directory.
  692. X.DE
  693. X
  694. X.*s 3 "Other Fields"
  695. X
  696. XThe 'tty' field may be used to select an
  697. Xoutgoing line
  698. Xother than the default
  699. X/dev/tty1a.
  700. XNote:  only the last two characters of the tty name
  701. Xneed be entered.  The remainder of the tty name
  702. Xis assumed to be '/dev/tty'.
  703. X
  704. XThe 'duplex' field may be used to select a
  705. Xduplex value other than the default 'F' (full).
  706. X
  707. XThe 'baud' field may be used to select a
  708. Xbaud rate value other than the default 2400.
  709. X
  710. XThe 'parity' field may be used to select a
  711. Xparity value other than the default 'N' (none).
  712. X
  713. X
  714. XThe 'Add NL to transmitted CR' and 'Add NL to received CR'
  715. Xfields are usually left defaulted to 'N' (no).  If you
  716. Xwill be communicating with a terminal (with a human), you
  717. Xwill usually need to set both of these fields to 'Y' as
  718. Xwell as to select 'H'alf duplex.
  719. X
  720. X.*s 3 "Special Characters"
  721. X
  722. XSpecial keyboard characters while filling in the
  723. Xstartup screen are:
  724. X
  725. X
  726. X.DS I
  727. X TAB    move to next field ... if nothing typed in
  728. X        the field, do not disturb contents
  729. X
  730. X ^B     back up to previous field
  731. X
  732. X END    proceed with session, dialing remote if
  733. X        logical directory entry name or literal
  734. X        telephone number enetered
  735. X
  736. X ^D     enter phone directory
  737. X
  738. X ESC    quit ecu without any communications
  739. X.DE
  740. X
  741. X.*s 2 "Command Line Arguments and Switches"
  742. X
  743. XECU can be started in a number of ways:
  744. X
  745. X.DS I
  746. Xecu [-lxx] [-b<baud>] [-h] [-e|-o] [-t] <tel-number>
  747. Xecu [-lxx] [-b<baud>] [-h] [-e|-o] [-t]
  748. Xecu [-t] <logical>
  749. Xecu [-lxx] [-b<baud>] [-h] [-e|-o] [-d] -p <proc> [<arg> ...]
  750. X.DE
  751. X
  752. X.*s 3 "-l"
  753. X
  754. XWhen ECU starts up, it normally chooses a line as described later
  755. Xin the section titled "Choosing a Dialout Line".
  756. XSpecifying the -l switch can suggest that the program
  757. Xchoose a specific line.  The argument to the switch is the
  758. Xlast two charcters of the ttyname; e.g., "-l1a".
  759. X
  760. XOn a system with HoneyDanBerr UUCP,
  761. Xto access a device which does not appear in the Devices file,
  762. Xit may be necessary to explicitly specify the device with -l.
  763. X
  764. X.*s 3 "-f"
  765. XNormally, ECU starts up in the full duplex mode.
  766. XIf half duplex is desired, the
  767. X.B
  768. X-f switch
  769. X.R
  770. Xis used.
  771. X
  772. X.*s 3 "-e, -o"
  773. X
  774. XNormally, ECU starts up with 8 data bits and no parity.
  775. XIf even parity is desired, the
  776. X.B
  777. X-e switch
  778. X.R
  779. Xis specified.
  780. XIf odd parity is desired, the
  781. X.B
  782. X-o switch
  783. X.R
  784. Xis specified.
  785. X
  786. XThese switches
  787. X
  788. X.*s 3 "-p <procname>"
  789. X
  790. XThe 
  791. X.B
  792. X-p switch
  793. X.R
  794. Xcauses ECU to execute the procedure <procname> ("<procname>.ep")
  795. Ximmediately.  Such a procedure is termed the
  796. X.B
  797. Xinitial procedure.
  798. X.R
  799. XAll non-switch arguments after <procname> are passed as arguments
  800. Xto the initial procedure (see the descriptions of the
  801. Xinteger function
  802. X.B %argc
  803. Xand the string function
  804. X.B %argv ).
  805. X
  806. X.*s 3 "-d"
  807. X
  808. XThe
  809. X.B
  810. X-d switch
  811. X.R
  812. Xinstructs ECU to "die" (terminate with error status) if
  813. Xany specified initial procedure fails.  This switch ensures a batch
  814. XECU execution will hang up any connection and terminate if
  815. Xa procedure error occurs.
  816. X
  817. XAbsence of the
  818. X.B
  819. X-d switch
  820. X.R
  821. Xcauses ecu (upon any completion of the
  822. Xinitial procedure) to enter the 1) interactive mode if a line
  823. Xwas successfully attached by the procedure or 2) the setup menu
  824. Xif not line was attached.
  825. X
  826. X.*s 3 "-t"
  827. X
  828. XThe
  829. X.B
  830. X-t switch
  831. X.R
  832. Xinstructs ECU to map incoming and outgoing carriage
  833. Xreturns to carriage return/line feed pairs.
  834. XThis is helpful if the remote connection will be to a
  835. Xterminal with a human operator.  Use of the
  836. X.B
  837. X-h switch
  838. X.R
  839. Xis probably also necessary.
  840. X
  841. X.*s 2 "Environment Variables"
  842. X
  843. XPrior to starting ECU, it is useful, but not necessary,
  844. Xto establish two environment variables, ECUPROMPT and ECUHELP.
  845. X
  846. X.*s 3 "ECUPROMPT"
  847. X
  848. XThe ECUPROMPT environment variable determines the prompt printed
  849. Xby ECU when the interactive command key ("HOME") is pressed.
  850. XWhen you first run ECU, try setting it to your name, e. g.,
  851. X.DS I
  852. Xsetenv ECUPROMPT Ralph    if you use csh
  853. X
  854. XECUPROMPT=Ralph           if you use sh, ksh, etc.
  855. Xexport ECUPROMPT
  856. X.DE
  857. XThen, when you see how it used, you may wish to
  858. Xestablish a more permanent choice in your .login or .profile.
  859. X
  860. X.*s 3 "ECUHELP"
  861. X
  862. XOrdinarily, ECU looks for interactive command help information
  863. Xin "/usr/lib/ecu/ecuhelp.data".
  864. XThe ECUHELP environment may be set to the complete
  865. Xpathname of the ecu help file if an alternate file
  866. Xis to be used.
  867. X
  868. XThe help file is explained later in the section
  869. Xtitled "Online Command Dictionary".
  870. X
  871. SHAR_EOF
  872. $TOUCH -am 0414232490 doc/_startup.txt &&
  873. chmod 0644 doc/_startup.txt ||
  874. echo "restore of doc/_startup.txt failed"
  875. set `wc -c doc/_startup.txt`;Wc_c=$1
  876. if test "$Wc_c" != "6175"; then
  877.     echo original size 6175, current size $Wc_c
  878. fi
  879. # ============= doc/_tech.txt ==============
  880. echo "x - extracting doc/_tech.txt (Text)"
  881. sed 's/^X//' << 'SHAR_EOF' > doc/_tech.txt &&
  882. X.*s 1 "Technical Notes"
  883. X
  884. XECU is written in Microsoft/SCO XENIX System V C.  Full use
  885. Xis made of function prototyping for ECU functions and external
  886. Xlibrary functions.  The source consists of 32,000 lines of source
  887. Xfiles (731000 bytes) and 2500 lines of header files (73000 bytes).
  888. XThe output of "size" for a -M3 version (actaul information may be
  889. Xobsolete):
  890. X
  891. X.DS I
  892. Xtext     data    bss     dec      hex
  893. X140940 + 34068 + 61852 = 236860 = 0x39d3c
  894. X.DE
  895. X
  896. X.*s 1 "Revision Numbers"
  897. X.DS L
  898. XECU revision numbers are defined as follows:
  899. X
  900. X     pppp#.##-#86x
  901. X      ^  ^ ^  ^  ^
  902. X      |  | |  |  `----- 's' if XENIX select(S) in use, 'n' if not
  903. X      |  | |  `-------- '2' for 286, '3' for 386
  904. X      |  | `----------- patch level
  905. X      |  `------------- major revision
  906. X      `---------------- package ('unet' for this release)
  907. X
  908. X.DE
  909. SHAR_EOF
  910. $TOUCH -am 1114014989 doc/_tech.txt &&
  911. chmod 0644 doc/_tech.txt ||
  912. echo "restore of doc/_tech.txt failed"
  913. set `wc -c doc/_tech.txt`;Wc_c=$1
  914. if test "$Wc_c" != "818"; then
  915.     echo original size 818, current size $Wc_c
  916. fi
  917. # ============= doc/_top.txt ==============
  918. echo "x - extracting doc/_top.txt (Text)"
  919. sed 's/^X//' << 'SHAR_EOF' > doc/_top.txt &&
  920. X
  921. X.de *s
  922. X.H "\\$1" "\\$2" \\$3 \\$4 \\$5 \\$6 \\$7 \\$8
  923. X.br
  924. X..
  925. X.po 4
  926. X.ll 7.2i
  927. X.ls 1
  928. X.nh
  929. X.tp
  930. X.sp 2i
  931. X.ft B
  932. X.ce 10
  933. XECU
  934. X
  935. X(Extended Call Utility)
  936. X.ce 0
  937. X.sp 1i
  938. X.ce 100
  939. XPersonal Communications Package
  940. Xfor XENIX System V
  941. X.ce 0
  942. X.ft P
  943. X.sp 2i
  944. X.lp
  945. XWarren H. Tucker, III <wht%n4hgf@gatech.edu>
  946. X.sp 1i
  947. X.ce 100
  948. XTechnical Description
  949. XRevision 1.22 (ecu 2.80)
  950. X\n(mo/\n(dy/\n(yr
  951. X.ce 0
  952. X.ls 1
  953. X.PH "'ECU Technical Description''%'"
  954. X.PF "'Public Domain by wht@n4hgf''\n(mo/\n(dy/\n(yr'"
  955. X.nr si 2n
  956. X.nr Cl 9
  957. X.nr Ej 1
  958. X.nr U 1
  959. X.SA 1
  960. X.ul
  961. X.bp 1
  962. X
  963. SHAR_EOF
  964. $TOUCH -am 0507235990 doc/_top.txt &&
  965. chmod 0644 doc/_top.txt ||
  966. echo "restore of doc/_top.txt failed"
  967. set `wc -c doc/_top.txt`;Wc_c=$1
  968. if test "$Wc_c" != "516"; then
  969.     echo original size 516, current size $Wc_c
  970. fi
  971. # ============= doc/ecu.txt ==============
  972. echo "x - extracting doc/ecu.txt (Text)"
  973. sed 's/^X//' << 'SHAR_EOF' > doc/ecu.txt &&
  974. X.so _top.txt
  975. X
  976. X.so _intro.txt
  977. X
  978. X.so _basic.txt
  979. X
  980. X.so _features.txt
  981. X
  982. X.so _startup.txt
  983. X
  984. X.so _icmd.txt
  985. X
  986. X.so _proc.txt
  987. X
  988. X.so _hdb.txt
  989. X
  990. X.so _tech.txt
  991. X
  992. X.so _end.txt
  993. SHAR_EOF
  994. $TOUCH -am 0711174289 doc/ecu.txt &&
  995. chmod 0644 doc/ecu.txt ||
  996. echo "restore of doc/ecu.txt failed"
  997. set `wc -c doc/ecu.txt`;Wc_c=$1
  998. if test "$Wc_c" != "155"; then
  999.     echo original size 155, current size $Wc_c
  1000. fi
  1001. # ============= doc/runoff ==============
  1002. echo "x - extracting doc/runoff (Text)"
  1003. sed 's/^X//' << 'SHAR_EOF' > doc/runoff &&
  1004. X#!/bin/csh
  1005. Xunset noclobber
  1006. Xecho 'nroff -mm ecu.txt | col > ecu.man'
  1007. Xnroff -mm ecu.txt |& col > ecu.man
  1008. X
  1009. SHAR_EOF
  1010. $TOUCH -am 0420005190 doc/runoff &&
  1011. chmod 0755 doc/runoff ||
  1012. echo "restore of doc/runoff failed"
  1013. set `wc -c doc/runoff`;Wc_c=$1
  1014. if test "$Wc_c" != "104"; then
  1015.     echo original size 104, current size $Wc_c
  1016. fi
  1017. # ============= models/bsd_uname.ep ==============
  1018. if test ! -d 'models'; then
  1019.     echo "x - creating directory models"
  1020.     mkdir 'models'
  1021. fi
  1022. echo "x - extracting models/bsd_uname.ep (Text)"
  1023. sed 's/^X//' << 'SHAR_EOF' > models/bsd_uname.ep &&
  1024. X#  CHK=0xFD46
  1025. X#--------------------------------------------------------------
  1026. X# bsd_uname.ep - get remote username from bsd system
  1027. X# return: $s0 = username
  1028. X#         $i0 = 1 if success, else 0
  1029. X#--------------------------------------------------------------
  1030. X#+:EDITS:*/
  1031. X#:07-11-1989-16:55-wht-get cmd became lgets
  1032. X#:06-28-1989-19:36-wht-use named variables
  1033. X#:06-25-1989-13:56-wht-new do command syntax
  1034. X#:06-25-1989-12:33-wht-new if/while syntax
  1035. X#:06-22-1989-13:30-wht-creation
  1036. X
  1037. X    set $s0='whoami'    # send command
  1038. X    do 'oneline'        # get $s0=username
  1039. X    ifi $i0 == 0         # we bombed?
  1040. X    {
  1041. X        set $i0=%colors; color red
  1042. X        echo 'bsd_uname: get user name failed'
  1043. X        icolor $i0
  1044. X        $i0 = 0
  1045. X    }
  1046. X
  1047. SHAR_EOF
  1048. $TOUCH -am 0507232990 models/bsd_uname.ep &&
  1049. chmod 0644 models/bsd_uname.ep ||
  1050. echo "restore of models/bsd_uname.ep failed"
  1051. set `wc -c models/bsd_uname.ep`;Wc_c=$1
  1052. if test "$Wc_c" != "673"; then
  1053.     echo original size 673, current size $Wc_c
  1054. fi
  1055. # ============= models/colors ==============
  1056. echo "x - extracting models/colors (Text)"
  1057. sed 's/^X//' << 'SHAR_EOF' > models/colors &&
  1058. X#colors - ecu color file
  1059. Xnormal lt_cyan black
  1060. Xreverse red white
  1061. Xnotify black gray
  1062. Xsuccess lt_green black
  1063. Xalert yellow black
  1064. Xerror red black
  1065. SHAR_EOF
  1066. $TOUCH -am 1015041989 models/colors &&
  1067. chmod 0644 models/colors ||
  1068. echo "restore of models/colors failed"
  1069. set `wc -c models/colors`;Wc_c=$1
  1070. if test "$Wc_c" != "140"; then
  1071.     echo original size 140, current size $Wc_c
  1072. fi
  1073. # ============= models/dir ==============
  1074. echo "x - extracting models/dir (Text)"
  1075. sed 's/^X//' << 'SHAR_EOF' > models/dir &&
  1076. X/tmp
  1077. X/usr/tmp
  1078. SHAR_EOF
  1079. $TOUCH -am 1103163889 models/dir &&
  1080. chmod 0644 models/dir ||
  1081. echo "restore of models/dir failed"
  1082. set `wc -c models/dir`;Wc_c=$1
  1083. if test "$Wc_c" != "14"; then
  1084.     echo original size 14, current size $Wc_c
  1085. fi
  1086. # ============= models/f.ep ==============
  1087. echo "x - extracting models/f.ep (Text)"
  1088. sed 's/^X//' << 'SHAR_EOF' > models/f.ep &&
  1089. X#  CHK=0x1C17
  1090. X#+------------------------------------------------------
  1091. X# f.eq - colorful finger on remote BSD system
  1092. X#-------------------------------------------------------
  1093. X#+:EDITS:*/
  1094. X#:07-11-1989-16:55-wht-get cmd became lgets
  1095. X#:06-30-1989-18:53-wht-creation
  1096. X
  1097. X    mkvar $icolor; $icolor = %colors
  1098. X    mkvar $itimeout; $itimeout = 50
  1099. X    send %argv(0)
  1100. X    lookfor '\n' 40
  1101. X    $s0 = ''
  1102. X    whilei 1==1
  1103. X    {
  1104. X        lgets $s00 $itimeout 5 '\n'
  1105. X        ifi $i0 == 0 continue
  1106. X        ifi %instr($s0,'% ') >= 0 break # prompt ends it
  1107. X        $itimeout = 20
  1108. X        color cyan
  1109. X        ifi %instr($s0,'Login') == 0 color gray
  1110. X        ifi %instr($s0,' i29 ') > 0 color green
  1111. X        ifi %instr($s0,' i13 ') > 0 color red
  1112. X        ifi %instr($s0,'cma') == 0 color yellow
  1113. X        ifi %instr($s0,'gfp') == 0 color lt_blue
  1114. X        ifi %instr($s0,'jts') == 0 color lt_blue
  1115. X        echo $s0
  1116. X    }
  1117. X    icolor $icolor
  1118. X    send ''
  1119. X
  1120. SHAR_EOF
  1121. $TOUCH -am 0507232990 models/f.ep &&
  1122. chmod 0640 models/f.ep ||
  1123. echo "restore of models/f.ep failed"
  1124. set `wc -c models/f.ep`;Wc_c=$1
  1125. if test "$Wc_c" != "815"; then
  1126.     echo original size 815, current size $Wc_c
  1127. fi
  1128. # ============= models/file_test.ep ==============
  1129. echo "x - extracting models/file_test.ep (Text)"
  1130. sed 's/^X//' << 'SHAR_EOF' > models/file_test.ep &&
  1131. X#  CHK=0xA2AF
  1132. X#------------------------------------------------------------
  1133. X#  ftst.ep - test ecu procedure file functions
  1134. X#------------------------------------------------------------
  1135. X
  1136. X ptrace off         # turn off trace mode
  1137. X fdel 'ftst.log'    # kill any previous file
  1138. X plog 'ftst.log'    # turn on logging
  1139. X
  1140. X echo ''
  1141. X echo 'ftst '+%date+' '+%time
  1142. X echo ''
  1143. X
  1144. X ptrace on                  # turn on trace mode
  1145. X
  1146. X set $s10 = '/tmp/ftst.tmp' # temp file name
  1147. X fdel $s10                  # test proc trace warning
  1148. X fopen -w 0 $s10            # open file 0 for write
  1149. X set i0=%ftell(0)           # should produce 0
  1150. X fputs 0 'abcdefghijk'      # put a line in the file
  1151. X set i0=%ftell(0)           # should produce 12
  1152. X fclose 0 n                 # close the file
  1153. X
  1154. X fopen -r 0 $s10    # open again for reading
  1155. X fgets 0 $s0        # should produce 'abcdefghijk'
  1156. X fseek 0 0          # rewind to read again
  1157. X fgets 0 $s0        # should produce 'abcdefghijk'
  1158. X fgets 0 $s0        # should produce null string
  1159. X set $i0=%fmode(0)  # test file mode function
  1160. X fclose 0           # close the file
  1161. X
  1162. X fchmod 'rw-rw-r-x' $s10 # set mode using string
  1163. X set $i0=%fmode($s10)
  1164. X
  1165. X fchmod 0777 $s10        # set mode using constant
  1166. X set $i0=%fmode($s10)
  1167. X
  1168. X ptrace off              # show file attributes
  1169. X echo ''
  1170. X echo -n $s10+' has '+%itos(%fsize($s10),06d)
  1171. X echo    ' (0x'+%itos(%fsize($s10),x  )+') bytes'
  1172. X echo 'accessed '+%edate(%fatime($s10))
  1173. X echo 'modified '+%edate(%fmtime($s10))
  1174. X echo ''
  1175. X ptrace on
  1176. X
  1177. X # demonstrate "is directory", "is character",
  1178. X # "is regular file" functions
  1179. X set i0=%isdir($s10),i1=%ischr($s10),i2=%isreg($s10)
  1180. X
  1181. X fdel $s10 # should say 'deleted'
  1182. X ptrace off
  1183. X plog off
  1184. SHAR_EOF
  1185. $TOUCH -am 0507232990 models/file_test.ep &&
  1186. chmod 0644 models/file_test.ep ||
  1187. echo "restore of models/file_test.ep failed"
  1188. set `wc -c models/file_test.ep`;Wc_c=$1
  1189. if test "$Wc_c" != "1667"; then
  1190.     echo original size 1667, current size $Wc_c
  1191. fi
  1192. # ============= models/frame_test.ep ==============
  1193. echo "x - extracting models/frame_test.ep (Text)"
  1194. sed 's/^X//' << 'SHAR_EOF' > models/frame_test.ep &&
  1195. X#  CHK=0xAB0B
  1196. X
  1197. X    set $i0 = 10
  1198. XLABEL
  1199. X    ifi $i0 > 0
  1200. X    {
  1201. X        set $i0,$i0=$i0-1
  1202. X        ifi $i0 = 5
  1203. X        {
  1204. X            echo 'nesting works!'
  1205. X        }
  1206. X        else ifi $i0 == 4
  1207. X        {
  1208. X            echo 'else works!'
  1209. X        }
  1210. X        goto LABEL
  1211. X    }
  1212. X
  1213. X    set $s0 = ''
  1214. X    whiles $s0 != 'aaaaa'
  1215. X    {
  1216. X        set $s0=$s0+'a'
  1217. X        ifs $s0 == 'aaaa' break
  1218. X        else echo '$s0=\''+$s0+'\''
  1219. X    }
  1220. X
  1221. X    echo 'done!'
  1222. SHAR_EOF
  1223. $TOUCH -am 0507232990 models/frame_test.ep &&
  1224. chmod 0644 models/frame_test.ep ||
  1225. echo "restore of models/frame_test.ep failed"
  1226. set `wc -c models/frame_test.ep`;Wc_c=$1
  1227. if test "$Wc_c" != "317"; then
  1228.     echo original size 317, current size $Wc_c
  1229. fi
  1230. # ============= models/goto_test.ep ==============
  1231. echo "x - extracting models/goto_test.ep (Text)"
  1232. sed 's/^X//' << 'SHAR_EOF' > models/goto_test.ep &&
  1233. X#  CHK=0xE30F
  1234. X# goto_test.ep
  1235. X#+:EDITS:*/
  1236. X#:06-07-1989-22:31-wht-creation
  1237. X    echo '... TRY1 goto test'; goto TRY1
  1238. X    echo '... TRY1 goto failed'
  1239. X    return
  1240. X
  1241. XBACK1    echo '... gotob succeeded'
  1242. X    gotob COMP
  1243. X
  1244. XTRY1    echo '... TRY1 goto succeeded'
  1245. X    gotob BACK1
  1246. X
  1247. XCOMP    echo '... COMPuted goto test'; set $s0='COMP'+'UTED',$s0
  1248. X    goto $s0
  1249. X    echo '... COMP failed'
  1250. X    return
  1251. X
  1252. XCOMPUTED
  1253. X    echo '... computed goto worked'
  1254. X    echo '... test complete'
  1255. X    return
  1256. X
  1257. X# vi:set tabstop=8:
  1258. SHAR_EOF
  1259. $TOUCH -am 0507232990 models/goto_test.ep &&
  1260. chmod 0644 models/goto_test.ep ||
  1261. echo "restore of models/goto_test.ep failed"
  1262. set `wc -c models/goto_test.ep`;Wc_c=$1
  1263. if test "$Wc_c" != "447"; then
  1264.     echo original size 447, current size $Wc_c
  1265. fi
  1266. # ============= models/keys ==============
  1267. echo "x - extracting models/keys (Text)"
  1268. sed 's/^X//' << 'SHAR_EOF' > models/keys &&
  1269. Xstratus
  1270. X    F1:F1:esc O q
  1271. X    F2:F2:esc O r
  1272. X    F3:F3:esc O s
  1273. X    F4:F4:esc O t
  1274. X    F5:F5:esc O u
  1275. X    F6:F6:esc O v
  1276. X    F7:F7:esc O w
  1277. X    F8:status:dc4
  1278. X    F9:no status:nl
  1279. X    F10:redisp:esc O y
  1280. X    F11:redisp:syn
  1281. X    PGDN:cancel:esc O Q
  1282. X    END:enter:esc O M
  1283. X    PGUP:dispform:esc O R
  1284. X    CUU:^:dle
  1285. X    CUD:v:so
  1286. X    CUL:<:stx
  1287. X    CUR:>:ack
  1288. X
  1289. Xremecu
  1290. X    F1:Home:0xC8
  1291. X    F2:End:0xC6
  1292. SHAR_EOF
  1293. $TOUCH -am 1103163889 models/keys &&
  1294. chmod 0644 models/keys ||
  1295. echo "restore of models/keys failed"
  1296. set `wc -c models/keys`;Wc_c=$1
  1297. if test "$Wc_c" != "322"; then
  1298.     echo original size 322, current size $Wc_c
  1299. fi
  1300. # ============= models/lookfortest.ep ==============
  1301. echo "x - extracting models/lookfortest.ep (Text)"
  1302. sed 's/^X//' << 'SHAR_EOF' > models/lookfortest.ep &&
  1303. X#  CHK=0xFA5C
  1304. X# lookfor_test.ep (needs a modem already attached)
  1305. X
  1306. X    send 'ate0q1'
  1307. X    nap 20
  1308. X    flush
  1309. X
  1310. X    send 'at'
  1311. X
  1312. X    lookfor 'OK'
  1313. X    ifi $i0 == 1 echo '... got false success'; return
  1314. X    ifi $i0 <> 0 echo '... got illogical result';set $i0;return
  1315. X    echo '... got good result for failure to read'
  1316. X
  1317. X    send 'ate1q0'
  1318. X
  1319. X    lookfor -e 'OK'+%chr(0x0D)+%chr(0x0A) 20
  1320. X    ifi $i0 == 0 echo '... got false failure'; return
  1321. X    ifi $i0 <> 1 echo '... got illogical result';set $i0;return
  1322. X    echo '... got good result for read'
  1323. X
  1324. X
  1325. X
  1326. X# vi: set tabstop=8:
  1327. SHAR_EOF
  1328. $TOUCH -am 0507232990 models/lookfortest.ep &&
  1329. chmod 0644 models/lookfortest.ep ||
  1330. echo "restore of models/lookfortest.ep failed"
  1331. set `wc -c models/lookfortest.ep`;Wc_c=$1
  1332. if test "$Wc_c" != "515"; then
  1333.     echo original size 515, current size $Wc_c
  1334. fi
  1335. # ============= models/mhack_test.ep ==============
  1336. echo "x - extracting models/mhack_test.ep (Text)"
  1337. sed 's/^X//' << 'SHAR_EOF' > models/mhack_test.ep &&
  1338. X#  CHK=0xEC1B
  1339. X#---------------------------------------------------------------------------
  1340. X#  mhack_test.ep - test %mhack while showing entertaining colors
  1341. X#  also useful to get a feeling for how fast the procedure language can be
  1342. X#---------------------------------------------------------------------------
  1343. X#+:EDITS:
  1344. X#:03-16-1990-05:25-wht@n4hgf-requires ecu x2.64 or later
  1345. X
  1346. X    echo 'SIGINT to quit\n'
  1347. X    $i20 = %colors
  1348. X    $i21 = %colors & 0xFFFFF0FF
  1349. X    whilei 1==1
  1350. X    {
  1351. X        $i0 = %mhack
  1352. X        $i1 = $i0 & 0xF00
  1353. X        icolor $i21 | $i1
  1354. X        echo -n %itos($i0,8d)+%chr(0x0d)
  1355. X    }
  1356. X    echo ''
  1357. X    icolor $i20
  1358. X
  1359. SHAR_EOF
  1360. $TOUCH -am 0507232990 models/mhack_test.ep &&
  1361. chmod 0644 models/mhack_test.ep ||
  1362. echo "restore of models/mhack_test.ep failed"
  1363. set `wc -c models/mhack_test.ep`;Wc_c=$1
  1364. if test "$Wc_c" != "578"; then
  1365.     echo original size 578, current size $Wc_c
  1366. fi
  1367. # ============= models/mkdir.ep ==============
  1368. echo "x - extracting models/mkdir.ep (Text)"
  1369. sed 's/^X//' << 'SHAR_EOF' > models/mkdir.ep &&
  1370. X#  CHK=0x91D9
  1371. X system 'mkdir '+%argv(1)
  1372. SHAR_EOF
  1373. $TOUCH -am 0507232990 models/mkdir.ep &&
  1374. chmod 0644 models/mkdir.ep ||
  1375. echo "restore of models/mkdir.ep failed"
  1376. set `wc -c models/mkdir.ep`;Wc_c=$1
  1377. if test "$Wc_c" != "40"; then
  1378.     echo original size 40, current size $Wc_c
  1379. fi
  1380. # ============= models/oneline.ep ==============
  1381. echo "x - extracting models/oneline.ep (Text)"
  1382. sed 's/^X//' << 'SHAR_EOF' > models/oneline.ep &&
  1383. X#  CHK=0xF093
  1384. X#--------------------------------------------------------------
  1385. X# oneline.ep
  1386. X#
  1387. X# send command in $s0, expecting a one line response
  1388. X# and a csh prompt ending in '% '
  1389. X#
  1390. X# returns: $s0 = one line response in $s0 if success
  1391. X#          $i0 = 1 if success, else 0
  1392. X#--------------------------------------------------------------
  1393. X#+:EDITS:*/
  1394. X#:07-11-1989-16:55-wht-get cmd became lgets
  1395. X#:06-28-1989-19:36-wht-use named variables
  1396. X#:06-25-1989-13:56-wht-new do command syntax
  1397. X#:06-25-1989-12:33-wht-new if/while syntax
  1398. X#:06-22-1989-13:30-wht-creation
  1399. X
  1400. X    mkvar $icsave; $icsave = %colors
  1401. X    color gray
  1402. X    send $s0                        # send command
  1403. X    lookfor -e %chr(0x0A) 50        # scan command echo
  1404. X    ifi $i0 == 0 icolor $i2;return    # if not found, return
  1405. X    lgets -e $s0 500 5 '\n'            # get one line response
  1406. X    lookfor '% ' 50                    # get prompt, don't echo
  1407. X    # $i0 = 1 if prompt, else 0
  1408. X    icolor $icsave
  1409. SHAR_EOF
  1410. $TOUCH -am 0507232990 models/oneline.ep &&
  1411. chmod 0644 models/oneline.ep ||
  1412. echo "restore of models/oneline.ep failed"
  1413. set `wc -c models/oneline.ep`;Wc_c=$1
  1414. if test "$Wc_c" != "877"; then
  1415.     echo original size 877, current size $Wc_c
  1416. fi
  1417. # ============= models/opuslogin.ep ==============
  1418. echo "x - extracting models/opuslogin.ep (Text)"
  1419. sed 's/^X//' << 'SHAR_EOF' > models/opuslogin.ep &&
  1420. X#  CHK=0xE753
  1421. X#+-----------------------------------------------------------------
  1422. X#  opuslogin.ep - ecu UNIX login procedure
  1423. X#  wht%n4hgf@gatech.edu
  1424. X#
  1425. X# %argv(1) = remote name
  1426. X# %argv(2) = first name
  1427. X# %argv(3) = last name
  1428. X# %argv(4) = password
  1429. X#+-----------------------------------------------------------------
  1430. X#+:EDITS:*/
  1431. X#:07-11-1989-16:55-wht-get cmd became lgets
  1432. X#:06-28-1989-19:36-wht-use named variables
  1433. X#:06-25-1989-13:56-wht-new do command syntax
  1434. X#:06-25-1989-12:33-wht-new if/while syntax
  1435. X#:06-23-1989-19:46-wht-improved hayes dialer reduces need to report dial fail
  1436. X#:06-19-1989-22:50-wht-use while and if statements
  1437. X#:06-14-1989-15:58-wht-add login capability when already connected
  1438. X#:06-11-1989-23:37-wht-creation
  1439. X
  1440. X    mkvar $i_csave,$i_ltimeout,$i_retries
  1441. X
  1442. X    $i_csave = %colors
  1443. X    $i_retries=3
  1444. X
  1445. X    color red;    echo -n '\nauto-logon to '
  1446. X    color yellow; echo -n %argv(1)
  1447. X    color red;    echo    ' on '+%date+' at '+%time+'\n'
  1448. X
  1449. X    ifi %argc != 5    # not enough args
  1450. X    {
  1451. X        color red
  1452. X        echo %argv(0)+' needs 5 arguments (got '+%itos(%argc)+')'
  1453. X        goto SORRY1
  1454. X    }
  1455. X
  1456. X    ifi %conn == 0 goto DIAL
  1457. X
  1458. X    ifs %rname == %argv(1)
  1459. X    {
  1460. X        color brown;  echo -n 'already connected to '
  1461. X        color yellow; echo    %rname
  1462. X        goto GET_LOGIN_PROMPT_RETRY
  1463. X    }
  1464. X
  1465. XHANGUP
  1466. X    ifi %conn <> 0 echo 'hanging up on '+%rname; hangup
  1467. X
  1468. XDIAL
  1469. X    color green
  1470. X    dial %argv(1); set $i1=$i0 #save dial result in $i1
  1471. X    ifi $i1 == 2 color red; echo 'interrupted'; goto SORRY
  1472. X    ifi $i1 != 0 goto SORRY
  1473. X
  1474. XTEST_MODEM_RESULT
  1475. X    ifs $s0 != 'CONNECT '+%itos(%baud)
  1476. X        color yellow; echo 'baud rate mismatch ... retrying'; goto HANGUP
  1477. X
  1478. X# give name to remote
  1479. X    lookfor -e 'FIRST name: ' 150
  1480. X    send %argv(2)
  1481. X    lookfor -e 'LAST name: ' 150
  1482. X    send %argv(3)
  1483. X
  1484. X    lookfor -e '[Y,n]? ' 40
  1485. X    send 'Y'
  1486. X
  1487. X    lookfor -e 'Password: ' 80
  1488. X    send %argv(4)
  1489. X    lookfor -e '\n'
  1490. X    set $i0=0
  1491. X    goto SETCOLOR_AND_RETURN_STATUS
  1492. X
  1493. X# procedure failed
  1494. XSORRY
  1495. X    echo ''
  1496. X    color red
  1497. X    echo '....... sorry'
  1498. X    set $i0=0
  1499. X    goto SETCOLOR_AND_RETURN_STATUS
  1500. X
  1501. XSORRY1
  1502. X    echo ''
  1503. X    color red
  1504. X    echo '....... sorry'
  1505. X    set $i0=1
  1506. X
  1507. XSETCOLOR_AND_RETURN_STATUS
  1508. X    icolor $i_csave
  1509. X    return $i0
  1510. X
  1511. X# vi:set tabstop=4 shiftwidth=4:
  1512. SHAR_EOF
  1513. $TOUCH -am 0507233390 models/opuslogin.ep &&
  1514. chmod 0644 models/opuslogin.ep ||
  1515. echo "restore of models/opuslogin.ep failed"
  1516. set `wc -c models/opuslogin.ep`;Wc_c=$1
  1517. if test "$Wc_c" != "2082"; then
  1518.     echo original size 2082, current size $Wc_c
  1519. fi
  1520. # ============= models/p.ep ==============
  1521. echo "x - extracting models/p.ep (Text)"
  1522. sed 's/^X//' << 'SHAR_EOF' > models/p.ep &&
  1523. X#  CHK=0x8848
  1524. X#+---------------------------------------------------------
  1525. X# p.eq - colorful, selective ps -aux on remote BSD system
  1526. X#----------------------------------------------------------
  1527. X#+:EDITS:*/
  1528. X#:07-11-1989-16:55-wht-get cmd became lgets
  1529. X#:06-30-1989-18:53-wht-creation
  1530. X
  1531. X    mkvar $icolor; $icolor = %colors
  1532. X    mkvar $itimeout; $itimeout = 50
  1533. X    send 'ps -aux'
  1534. X    lookfor '\n' 40
  1535. X    $s0 = ''
  1536. X    whilei 1==1
  1537. X    {
  1538. X        lgets $s00 $itimeout 5 '\n'
  1539. X        ifi $i0 == 0 continue
  1540. X        $itimeout = 20
  1541. X        ifi %instr($s0,'% ') >= 0 break    # prompt ends it
  1542. X        color cyan
  1543. X        ifi %instr($s0,'getty') >= 0 continue
  1544. X        ifi %instr($s0,'/etc') >= 0 continue
  1545. X        ifi %instr($s0,'rlogin') >= 0 continue
  1546. X        ifi %instr($s0,'biod') >= 0 continue
  1547. X        ifi %instr($s0,'csh') >= 0 continue
  1548. X        ifi %instr($s0,'/usr/lib') >= 0 continue
  1549. X        ifi %instr($s0,' i29 ') > 0 color green
  1550. X        ifi %instr($s0,' i13 ') > 0 color red
  1551. X        ifi %instr($s0,'cma') == 0 color yellow
  1552. X        ifi %instr($s0,'gfp') == 0 color lt_blue
  1553. X        ifi %instr($s0,'jts') == 0 color lt_blue
  1554. X        ifi %instr($s0,'UUCP') >= 0 color red
  1555. X        ifi %instr($s0,'uu') >= 0 color red
  1556. X        echo $s0
  1557. X    }
  1558. X    icolor $icolor
  1559. X    send ''
  1560. X
  1561. SHAR_EOF
  1562. $TOUCH -am 0507232990 models/p.ep &&
  1563. chmod 0640 models/p.ep ||
  1564. echo "restore of models/p.ep failed"
  1565. set `wc -c models/p.ep`;Wc_c=$1
  1566. if test "$Wc_c" != "1110"; then
  1567.     echo original size 1110, current size $Wc_c
  1568. fi
  1569. # ============= models/phone ==============
  1570. echo "x - extracting models/phone (Text)"
  1571. sed 's/^X//' << 'SHAR_EOF' > models/phone &&
  1572. X# when saving this file, ECU will preserve commented lines
  1573. X#alpha2:1(714)821-9672::2400:N:alphacm rotary 2 (uucp)
  1574. X#kermit:1(419)537-4411::1200:E:Kermit
  1575. X#sco2:1(408)425-3502::2400:N:sosco uucp
  1576. Xalphacm:1(714)821-9671::2400:N:alphacm rotary 1
  1577. Xnavobs:1(202)653-0351::1200:N:Naval Observatory Time
  1578. Xsco:1(408)426-9495::2400:N:SCO Tech Services (SOS)
  1579. SHAR_EOF
  1580. $TOUCH -am 1103163789 models/phone &&
  1581. chmod 0644 models/phone ||
  1582. echo "restore of models/phone failed"
  1583. set `wc -c models/phone`;Wc_c=$1
  1584. if test "$Wc_c" != "344"; then
  1585.     echo original size 344, current size $Wc_c
  1586. fi
  1587. # ============= models/phrases ==============
  1588. echo "x - extracting models/phrases (Text)"
  1589. sed 's/^X//' << 'SHAR_EOF' > models/phrases &&
  1590. Xstty:stty intr ^C kill ^U erase ^H^r
  1591. Xmail-csh:mail emory\!tridom\!n4hgf\!wht^r
  1592. Xmail-sh:mail emory!tridom!n4hgf!wht^r
  1593. SHAR_EOF
  1594. $TOUCH -am 1103164089 models/phrases &&
  1595. chmod 0604 models/phrases ||
  1596. echo "restore of models/phrases failed"
  1597. set `wc -c models/phrases`;Wc_c=$1
  1598. if test "$Wc_c" != "117"; then
  1599.     echo original size 117, current size $Wc_c
  1600. fi
  1601. # ============= models/ps.ep ==============
  1602. echo "x - extracting models/ps.ep (Text)"
  1603. sed 's/^X//' << 'SHAR_EOF' > models/ps.ep &&
  1604. X#  CHK=0xDA50
  1605. X#+------------------------------------------------------
  1606. X# p.eq
  1607. X#-------------------------------------------------------
  1608. X#+:EDITS:*/
  1609. X#:07-11-1989-16:55-wht-get cmd became lgets
  1610. X#:06-30-1989-18:53-wht-creation
  1611. X
  1612. X    mkvar $icolor; $icolor = %colors
  1613. X    send %argv(0)+' '+%argv(1)+' '+%argv(2)
  1614. X    lookfor '\n' 40
  1615. X    $s0 = ''
  1616. X    whilei 1==1
  1617. X    {
  1618. X        lgets $s0 60 60 '\n'
  1619. X        color cyan
  1620. X        ifi %instr($s0,'(getty)' >= 0 continue
  1621. X        else ifi %instr($s0,'(tcsh)' >= 0 continue
  1622. X        else ifi %instr($s0,'(csh)' >= 0 continue
  1623. X        else ifi %instr($s0,'(sh)' >= 0 continue
  1624. X        else ifi %instr($s0,'/etc/init' >= 0 continue
  1625. X        else ifi %instr($s0,'% ') >= 0 break
  1626. X        else ifi %instr($s0,'USER') == 0 color gray
  1627. X        else ifi %instr($s0,' i29 ') > 0 color red
  1628. X        else ifi %instr($s0,' i13 ') > 0 color green
  1629. X        else ifi %instr($s0,'cma') == 0 color yellow
  1630. X        echo $s0
  1631. X    }
  1632. X    icolor $icolor
  1633. X    send ''
  1634. X
  1635. SHAR_EOF
  1636. $TOUCH -am 0507232990 models/ps.ep &&
  1637. chmod 0644 models/ps.ep ||
  1638. echo "restore of models/ps.ep failed"
  1639. set `wc -c models/ps.ep`;Wc_c=$1
  1640. if test "$Wc_c" != "863"; then
  1641.     echo original size 863, current size $Wc_c
  1642. fi
  1643. # ============= models/put_ecu.ep ==============
  1644. echo "x - extracting models/put_ecu.ep (Text)"
  1645. sed 's/^X//' << 'SHAR_EOF' > models/put_ecu.ep &&
  1646. X#  CHK=0x6289
  1647. X#--------------------------------------------------------------
  1648. X# put_ecu.ep - update remote copy of ecu sources
  1649. X#--------------------------------------------------------------
  1650. X#+:EDITS:*/
  1651. X#:07-11-1989-16:55-wht-get cmd became lgets
  1652. X#:06-28-1989-19:36-wht-use named variables
  1653. X#:06-25-1989-14:28-wht-use rz_update
  1654. X
  1655. X    $s10 = %rname
  1656. X    ifi %instr($s10,'tridom') == 0
  1657. X        $s10 = 'tridom'
  1658. X
  1659. X    ifs $s10 == 'tridom'
  1660. X    {
  1661. X        $s0 = '/u3/sd/wht/src/ecu'
  1662. X        $s1 = '/u1/src/ecu' 
  1663. X        $s2 = '`ff \'*.c\' \'*.h\' Makefile \'*.ep\' \'.mi\' \'*.txt\' \'*.man\'` xsel386/*'
  1664. X        $s3 = 'wht'
  1665. X        goto CALL_SZ_UPDATE
  1666. X    }
  1667. X    else ifs $s10== 'ki4xo'
  1668. X    {
  1669. X        $s0 = '/user/wht/src/ecu'
  1670. X        $s1 = '/u1/src/ecu' 
  1671. X        $s2 = '{.,z}/{Makefile,*.{c,h}} `ff \'*.ep\' \'.mi\' \'*.man\'` xsel386/*'
  1672. X        $s3 = 'wht'
  1673. X        goto CALL_SZ_UPDATE
  1674. X    }
  1675. X    else ifs $s10== 'coke-jsm'
  1676. X    {
  1677. X        $i39=%colors
  1678. X        color red; echo '\n\nHAVE YOU MADE A NO-SELECT VERSION???????\n\n'
  1679. X        mkvar $s_rpwd(20)
  1680. X        echo -n 'root password? ' ; $s_rpwd = %cgets
  1681. X        icolor $i39
  1682. X        $s0 = '/usr/wht/bin'
  1683. X        $s1 = '/u1/src/ecu'
  1684. X        $s2 = 'ecu'
  1685. X        $s3 = 'wht'
  1686. X        do 'sz_update' $s0  $s1 $s2 $s3 %argv(0)
  1687. X        lookfor '% ' 40
  1688. X        $s0 = '/usr/wht/bin'
  1689. X        $s1 = '/usr/wht/bin'
  1690. X        $s2 = 'ecusz ecurz ecusea'
  1691. X        $s3 = 'wht'
  1692. X        do 'sz_update' $s0  $s1 $s2 $s3 %argv(0)
  1693. X        lookfor '% ' 40
  1694. X        $s0 = '/usr/wht'
  1695. X        $s1 = '/u1/src/ecu/doc'
  1696. X        $s2 = '*.man'
  1697. X        $s3 = 'wht'
  1698. X        do 'sz_update' $s0  $s1 $s2 $s3 %argv(0)
  1699. X        lookfor '% ' 40
  1700. X        $s0 = '/usr/wht/.ecu'
  1701. X        $s1 = '/u1/src/ecu/models'
  1702. X        $s2 = '*'
  1703. X        $s3 = 'wht'
  1704. X        do 'sz_update' $s0  $s1 $s2 $s3 %argv(0)
  1705. X        lookfor '% ' 40
  1706. X        $s0 = '/usr/lib/ecu'
  1707. X        $s1 = $s0
  1708. X        $s2 = '*'
  1709. X        $s3 = ''
  1710. X        do 'su-csh' 'root' $s_rpwd
  1711. X        do 'sz_update' $s0  $s1 $s2 $s3 %argv(0)
  1712. X        send -e 'chmod u+s /usr/lib/ecu/ecuungetty'
  1713. X        send %chr(0x04)
  1714. X        return
  1715. X    }
  1716. X    else echo 'not to '+$s10+' you don\'t'
  1717. X
  1718. X# $s0 = remote directory
  1719. X# $s1 = local directory
  1720. X# $s2 = file list
  1721. X# $s3 = necessary username on remote system
  1722. XCALL_SZ_UPDATE
  1723. X    do 'sz_update' $s0  $s1 $s2 $s3 %argv(0)
  1724. SHAR_EOF
  1725. $TOUCH -am 0507232990 models/put_ecu.ep &&
  1726. chmod 0644 models/put_ecu.ep ||
  1727. echo "restore of models/put_ecu.ep failed"
  1728. set `wc -c models/put_ecu.ep`;Wc_c=$1
  1729. if test "$Wc_c" != "1963"; then
  1730.     echo original size 1963, current size $Wc_c
  1731. fi
  1732. # ============= models/root.ep ==============
  1733. echo "x - extracting models/root.ep (Text)"
  1734. sed 's/^X//' << 'SHAR_EOF' > models/root.ep &&
  1735. X#  CHK=0x8FE9
  1736. X
  1737. X#  CHK=0x067D
  1738. X#+----------------------------------------------
  1739. X# su-root.ep
  1740. X#-----------------------------------------------
  1741. X#+:EDITS:*/
  1742. X#:07-11-1989-16:55-wht-get cmd became lgets
  1743. X#:06-28-1989-19:36-wht-use named variables
  1744. X#:06-27-1989-17:02-wht-working
  1745. X
  1746. X    mkvar icsave;$icsave = %colors
  1747. X    color lt_blue black
  1748. X    echo -n 'remote root password? '
  1749. X    color black black
  1750. X    $s0 = %cgets
  1751. X    icolor $icsave
  1752. X    do 'su' 'root' $s0
  1753. X    $s0 = ''        # forget password
  1754. X    lookfor '% ' 100 # swallow prompt
  1755. X    send 'source ~wht/.cshrc'
  1756. SHAR_EOF
  1757. $TOUCH -am 0507232990 models/root.ep &&
  1758. chmod 0644 models/root.ep ||
  1759. echo "restore of models/root.ep failed"
  1760. set `wc -c models/root.ep`;Wc_c=$1
  1761. if test "$Wc_c" != "518"; then
  1762.     echo original size 518, current size $Wc_c
  1763. fi
  1764. # ============= models/rz_update.ep ==============
  1765. echo "x - extracting models/rz_update.ep (Text)"
  1766. sed 's/^X//' << 'SHAR_EOF' > models/rz_update.ep &&
  1767. X#  CHK=0x3514
  1768. X#--------------------------------------------------------------
  1769. X# rz_update.ep - update local directory
  1770. X#
  1771. X# parameters:
  1772. X# %argv(1) = remote directory to copy from
  1773. X# %argv(2) = local directory to copy to
  1774. X# %argv(3) = file list to get
  1775. X# %argv(4) = remote username needed, if any, else null
  1776. X#            if %argv(4) not null, 'su_'+%argv(4)+".ep" must
  1777. X#            exist to su to remote
  1778. X# %argv(5)   name of superior procedure
  1779. X#
  1780. X#--------------------------------------------------------------
  1781. X#+:EDITS:*/
  1782. X#:07-11-1989-16:55-wht-get cmd became lgets
  1783. X#:06-28-1989-19:36-wht-use named variables
  1784. X#:06-25-1989-13:56-wht-new do command syntax
  1785. X#:06-25-1989-12:33-wht-new if/while syntax
  1786. X#:06-22-1989-13:30-wht-creation
  1787. X
  1788. X# variable usage
  1789. X    mkvar $i_csave            # color settings at entry to procedure
  1790. X    mkvar $i_rtnval            # return code
  1791. X    mkvar $i_suflag            # true if su occurred
  1792. X    mkvar $s_origdir(128)    # original working directory
  1793. X    mkvar $s_rdir(128)        # remote directory we started with
  1794. X    mkvar $s_ruser(16)        # remote username we started with before su
  1795. X    mkvar $s_xtitle(64)        # title for xfer
  1796. X
  1797. X    $i_csave=%colors # get colors at entry
  1798. X
  1799. X    $s_xtitle = 'Connected to '+%rname
  1800. X    ifs %argv(5) != ''
  1801. X        $s_xtitle = $s_xtitle+' - procedure '+%argv(5)
  1802. X
  1803. X# check to make sure we are connected
  1804. X    ifi %conn == 0
  1805. X    {
  1806. X        color red; echo 'not connected to anyone!'
  1807. X        goto SORRY
  1808. X    }
  1809. X    color lt_blue;  echo 'Connected to '+%rname
  1810. X
  1811. X# save local current directory and change to target
  1812. X    $s_origdir=%dir
  1813. X    color brown
  1814. X    ifs $s_origdir == %argv(2)
  1815. X        echo -n 'local directory already '
  1816. X    else 
  1817. X    {
  1818. X        cd %argv(2)
  1819. X        echo -n 'local directory set to '
  1820. X    }
  1821. X    color yellow; echo %dir
  1822. X
  1823. X# make sure remote username ok
  1824. X    ifs %argv(4) == '' goto REMOTE_CD # if any remote username
  1825. X    do 'bsd_uname'            # get $s0=username
  1826. X    ifi $i0 == 0 goto SORRY    # test failure
  1827. X    $s_ruser = $s0            # save original remote username
  1828. X    ifs $s0 != %argv(4)
  1829. X    {                        # need to su
  1830. X        color brown
  1831. X        echo -n 'remote username '
  1832. X        color yellow
  1833. X        echo -n $s0
  1834. X        color brown
  1835. X        echo ' ... su to '+%argv(4)+' now'
  1836. X        color gray
  1837. X        do 'su_'+%argv(4)    # call proc, which calls su.ep
  1838. X        lookfor '% ' 50        # su leaves prompt in buffer: swallow
  1839. X        do 'bsd_uname'        # make sure we su'd
  1840. X        ifi $i0 == 0 goto SORRY
  1841. X        ifs $s0 != %argv(4)    # failed to su?
  1842. X        {
  1843. X            color red;echo 'su to '+%argv(4)+' failed'
  1844. X            goto SORRY
  1845. X        }
  1846. X        $i_suflag = 1        # remember we su'd
  1847. X    }    # now we are proper username on remote
  1848. X
  1849. X# establish proper remote working directory
  1850. XREMOTE_CD
  1851. X    color gray
  1852. X    $s0 = 'pwd';do 'oneline'    # save old remote ...
  1853. X    $s_rdir = $s0                # ... directory in $s_rdir
  1854. X    ifs $s_rdir != %argv(1)        # if cd needed, do it
  1855. X    {
  1856. X        send 'cd '+%argv(1)        # remote cd
  1857. X        lookfor -e '\n' 50        # echo command
  1858. X        lookfor '% ' 50            # swallow prompt
  1859. X        $s0 = 'pwd'
  1860. X        do 'oneline'            # make sure we got there
  1861. X        ifs $s0 != %argv(1)        # dir change failed
  1862. X        {
  1863. X            color red;echo 'remote cd failed'
  1864. X            goto SORRY;
  1865. X        }
  1866. X    }
  1867. X    color brown;  echo -n 'remote directory '
  1868. X    color yellow; echo -n %argv(1)
  1869. X    color brown;  echo    ' ... starting transfer now'
  1870. X
  1871. X# transfer files
  1872. X    color lt_blue
  1873. X    send 'sz -n -f '+%argv(3)
  1874. X    lookfor -e '\n' 50    # echo remote command
  1875. X    ifi $i0 == 0        # command failed?
  1876. X    {
  1877. X        color red; echo 'sz command failed or garbled echo'
  1878. X        goto SORRY
  1879. X    }
  1880. X    color brown
  1881. X    echo 'waiting for sz to start'
  1882. X    nap 10
  1883. X    color gray
  1884. X#    $s5 = '**'+%chr(0x18)+'B'    # ZMODEM header
  1885. X    lgets $s0 150 10 '\n'        # wait 15 secs for start
  1886. X    ifi %instr($s0,'rz') < 0    # check for 'rz' startup from remote
  1887. X    {
  1888. X        color white;
  1889. X        echo '\n'+$s0+'\n'
  1890. X        color red
  1891. X        echo 'sz protocol failure or trigger garbled'
  1892. X        goto SORRY
  1893. X    }
  1894. X    icolor $i_csave                # restore colors at entry
  1895. X    rz -l $s_xtitle
  1896. X    ifi $i0 != 0    # whoops
  1897. X    {
  1898. X        color red; echo -n '\nTRANSFER FAILED ... '
  1899. X        ifi $i0 == 0x100 echo 'interrupt'
  1900. X        ifi $i0 != 0x100 echo 'termination status '+%itos($i0,04d)
  1901. X        goto SORRY
  1902. X    }
  1903. X    lookfor '% ' 50                # swallow prompt
  1904. X    goto RETURN
  1905. X
  1906. XSORRY # whoops
  1907. X    color red;echo 'rz_update failed ... sorry'
  1908. X    $i_rtnval = 1                # return error
  1909. X
  1910. XRETURN
  1911. X    echo ''
  1912. X    color brown;  echo -n 'remote user name '
  1913. X    color yellow
  1914. X    ifi $i_suflag != 0            # we su'd
  1915. X    {
  1916. X        send -n %chr(0x04)      # will force a new prompt from remote
  1917. X        echo -n $s_ruser
  1918. X        color brown;  echo ' restored (sent ^D to '+%argv(4)+' shell)'
  1919. X        lookfor '% ' 50            # swallow prompt
  1920. X    }
  1921. X    else
  1922. X        color brown;  echo 'unchanged'
  1923. X
  1924. X    ifs $s_rdir != %argv(1)        # if we did a remote cd
  1925. X    {
  1926. X        send 'cd '+$s_rdir        # restore original
  1927. X        lookfor '\n'
  1928. X        color brown;  echo -n 'remote working directory '
  1929. X        color yellow; echo -n $s_rdir
  1930. X        color brown;  echo    ' restored'
  1931. X    }
  1932. X    else
  1933. X    {
  1934. X        send ''                # spark a prompt
  1935. X        color brown;  echo -n 'remote working directory '
  1936. X        color yellow; echo -n $s_rdir
  1937. X        color brown;  echo    ' unchanged'
  1938. X    }
  1939. X
  1940. X    ifs $s_origdir != %dir    # restore original directory
  1941. X    {
  1942. X        cd $s_origdir
  1943. X        color brown;  echo -n 'local working directory '
  1944. X        color yellow; echo -n $s_origdir
  1945. X        color brown;  echo    ' restored'
  1946. X    }
  1947. X
  1948. X    icolor $i_csave        # restore colors at entry
  1949. X    echo ''
  1950. X    return $i_rtnval    # return selected error code (bomb procedure if error)
  1951. SHAR_EOF
  1952. $TOUCH -am 0507232990 models/rz_update.ep &&
  1953. chmod 0644 models/rz_update.ep ||
  1954. echo "restore of models/rz_update.ep failed"
  1955. set `wc -c models/rz_update.ep`;Wc_c=$1
  1956. if test "$Wc_c" != "4983"; then
  1957.     echo original size 4983, current size $Wc_c
  1958. fi
  1959. # ============= models/senddate.ep ==============
  1960. echo "x - extracting models/senddate.ep (Text)"
  1961. sed 's/^X//' << 'SHAR_EOF' > models/senddate.ep &&
  1962. X#  CHK=0x067D
  1963. X#+----------------------------------------------
  1964. X# senddate.ep
  1965. X#-----------------------------------------------
  1966. X#+:EDITS:*/
  1967. X#:07-11-1989-16:55-wht-get cmd became lgets
  1968. X#:06-28-1989-19:36-wht-use named variables
  1969. X#:06-27-1989-17:02-wht-working
  1970. X
  1971. X    mkvar icsave;$icsave = %colors
  1972. X    color blue
  1973. X    echo -n 'remote root password? '
  1974. X    color black
  1975. X    $s0 = %cgets
  1976. X    icolor $icsave
  1977. X    do 'su' 'root' $s0
  1978. X    $s0 = ''        # forget password
  1979. X    lookfor '% ' 50 # swallow prompt
  1980. X    send 'date'
  1981. X    lookfor -e '% ' 50
  1982. X    system -l 'senddate'
  1983. X    lookfor -e quiet 20
  1984. X    send -n %chr(0x04)
  1985. SHAR_EOF
  1986. $TOUCH -am 0507232990 models/senddate.ep &&
  1987. chmod 0644 models/senddate.ep ||
  1988. echo "restore of models/senddate.ep failed"
  1989. set `wc -c models/senddate.ep`;Wc_c=$1
  1990. if test "$Wc_c" != "557"; then
  1991.     echo original size 557, current size $Wc_c
  1992. fi
  1993. # ============= models/su.ep ==============
  1994. echo "x - extracting models/su.ep (Text)"
  1995. sed 's/^X//' << 'SHAR_EOF' > models/su.ep &&
  1996. X#  CHK=0x120D
  1997. X#+---------------------------------------------------------
  1998. X# su.ep - switch user at remote
  1999. X# wht%n4hgf@gatech.edu
  2000. X#
  2001. X# do su 'username' 'password' ['.']
  2002. X#
  2003. X# expects new user to be running csh
  2004. X#----------------------------------------------------------
  2005. X#+:EDITS:*/
  2006. X#:07-11-1989-16:55-wht-get cmd became lgets
  2007. X#:06-28-1989-19:36-wht-use named variables
  2008. X#:06-27-1989-12:43-wht-"get prompt" message was wrong
  2009. X#:06-25-1989-13:56-wht-new do command syntax
  2010. X#:06-25-1989-12:33-wht-new if/while syntax
  2011. X#:06-16-1989-18:12-wht-creation
  2012. X
  2013. X    mkvar icsave; $icsave = %colors
  2014. X
  2015. X    color gray
  2016. X    send 'su '+%argv(1)
  2017. X    lookfor -e 'word:' 70
  2018. X    ifi $i0 == 0
  2019. X    {
  2020. X        color red;echo 'su: failed to get password prompt'
  2021. X        icolor $icsave; return 1
  2022. X    }
  2023. X    send %argv(2); lookfor '\n' 50    # send password
  2024. X    echo ''
  2025. X    lgets $s0 70 5 '\n'
  2026. X    ifi %instr($s0,'Sorry') >= 0
  2027. X    {
  2028. X        color red;echo 'su: remote said "Sorry"'
  2029. X        icolor $icsave; return 1
  2030. X    }
  2031. X    nap 5                        # wait .5 sec
  2032. X    send 'set prompt="% "'        # set '% ' as prompt
  2033. X    lookfor '\n' 20                # swallow echo of set command
  2034. X    lookfor '% ' 60                # look for new prompt
  2035. X    ifi $i0 == 0
  2036. X    {
  2037. X        color lt_red
  2038. X        echo 'timeout on prompt ... system may be slow ... waiting 5 more secs'
  2039. X        color gray
  2040. X        lookfor '% ' 50                # look for new prompt
  2041. X    }
  2042. X    ifi $i0 == 0
  2043. X    {
  2044. X        color red;echo 'su: failed to "get prompt" echo'
  2045. X        icolor $icsave; return 2
  2046. X    }
  2047. X    ifs %argv(3) == '.'
  2048. X        send 'source ~wht/.cshrc'
  2049. X    else
  2050. X        send ''; lookfor '\n' 50    # kick off another prompt
  2051. X    icolor $icsave
  2052. SHAR_EOF
  2053. $TOUCH -am 0507233390 models/su.ep &&
  2054. chmod 0644 models/su.ep ||
  2055. echo "restore of models/su.ep failed"
  2056. set `wc -c models/su.ep`;Wc_c=$1
  2057. if test "$Wc_c" != "1465"; then
  2058.     echo original size 1465, current size $Wc_c
  2059. fi
  2060. echo "End of part 28, continue with part 29"
  2061. exit 0
  2062.  
  2063.