home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sources / misc / 3964 < prev    next >
Encoding:
Text File  |  1992-09-15  |  57.2 KB  |  1,962 lines

  1. Newsgroups: comp.sources.misc
  2. Path: sparky!kent
  3. From: wht@n4hgf.Mt-Park.GA.US (Warren Tucker)
  4. Subject:  v32i072:  ecu - ECU Asynchronous Communications v3.20, Part37/40
  5. Message-ID: <1992Sep15.153736.20912@sparky.imd.sterling.com>
  6. Followup-To: comp.sources.d
  7. X-Md4-Signature: be316a86a0a934c6654e8d45a7a3c6a6
  8. Sender: kent@sparky.imd.sterling.com (Kent Landfield)
  9. Organization: Sterling Software
  10. References: <csm-v32i036=ecu.141245@sparky.IMD.Sterling.COM>
  11. Date: Tue, 15 Sep 1992 15:37:36 GMT
  12. Approved: kent@sparky.imd.sterling.com
  13. Lines: 1947
  14.  
  15. Submitted-by: wht@n4hgf.Mt-Park.GA.US (Warren Tucker)
  16. Posting-number: Volume 32, Issue 72
  17. Archive-name: ecu/part37
  18. Environment: SCO,XENIX,ISC,SUNOS,SYSVR4,HDB,Curses
  19. Supersedes: ecu: Volume 21, Issue 53-89
  20.  
  21. ---- Cut Here and feed the following to sh ----
  22. #!/bin/sh
  23. # this is ecu320.37 (part 37 of ecu320)
  24. # do not concatenate these parts, unpack them in order with /bin/sh
  25. # file doc/_icmd.txt continued
  26. #
  27. if test ! -r _shar_seq_.tmp; then
  28.     echo 'Please unpack part 1 first!'
  29.     exit 1
  30. fi
  31. (read Scheck
  32.  if test "$Scheck" != 37; then
  33.     echo Please unpack part "$Scheck" next!
  34.     exit 1
  35.  else
  36.     exit 0
  37.  fi
  38. ) < _shar_seq_.tmp || exit 1
  39. if test ! -f _shar_wnt_.tmp; then
  40.     echo 'x - still skipping doc/_icmd.txt'
  41. else
  42. echo 'x - continuing file doc/_icmd.txt'
  43. sed 's/^X//' << 'SHAR_EOF' >> 'doc/_icmd.txt' &&
  44. Xor later.  The file ~/.kermrc must be set up to have any desired
  45. Xinitialization parameters you desire (refer to C-Kermit
  46. Xdocumentation for more information).
  47. XThe remote protocol must have been started prior to the
  48. Xexecution of this command.
  49. X
  50. XWARNING: until further notice, avoid suspending Kermit
  51. Xwith ^\Z.  ECU is totally unprepared to act as a job control
  52. Xprocess group leader.
  53. X
  54. X.*s 2 "RS : receive via SEAlink"
  55. X.DS L
  56. Xusage: rs
  57. X.DE
  58. X
  59. XThis command invokes a SEAlink receive protocol.
  60. X
  61. X.*s 2 "RTScts : control RTS/CTS flow control"
  62. X.DS L
  63. Xusage: rtscts [ off | on | no | yes | 0..7 ]
  64. X.DE
  65. X
  66. XThis command controls the RTS/CTS flow control feature of
  67. Xthe line driver (which may or may not work).
  68. XThis is a very confusing area though it should not be.
  69. X
  70. XIf no argument is supplied, the current setting is
  71. Xdisplayed.  Specifying 0 or n disables the facility;
  72. X1 or y causes RTS/CTS flow control to be enabled.
  73. X
  74. XWhat the command does is to manipulate the RTSFLOW and CTSFLOW
  75. Xbits of the termio c_cflag word (see 
  76. X.B termio(S) ).
  77. X
  78. XSCO's sio driver before UNIX 3.2v4/ODT 2.0
  79. Xdoes half duplex flow control.
  80. XFAS does hardware flow control based on the device magic
  81. Xnumber, but if you use a device number specifying no hardware flow
  82. Xcontrol, RTSFLOW and CTSFLOW can be used to specify SCO-style flow
  83. Xcontrol.
  84. XCRTSFL offers full duplex line control
  85. Xon 3.2v4 and later ONLY for SCO's sio driver.
  86. X
  87. X.DS I
  88. X arg | RTSFLOW | CTSFLOW    arg | RTSFLOW | CTSFLOW | CRTSFL
  89. X-----+---------+---------  -----+---------+---------+--------
  90. X off |   0     |   0         0  |   0     |   0     |
  91. X on  |   0     |   1         1  |   0     |   1     |
  92. X no  |   0     |   0         2  |   1     |   0     |
  93. X yes |   0     |   1         3  |   1     |   1     |
  94. X                             4  |   0     |   0     |   1
  95. X.DE
  96. XChoice 4 only works on SCO 3.2v4 and ODT 2.0.
  97. XAs you can see, numeric values are masks.
  98. XIf the 4 bit is present in the numeric value, it
  99. Xoverrides the lower-order bits:  Specifying 7 as an argument
  100. Xspecifies CRTSFL is to be used if it is supported, otherwise
  101. XRTSFLOW and CTSFLOW.
  102. X
  103. XUnder System V Release 4, an TCGETX/TCSETX manipulation
  104. Xis performed, modifying the x_hflag bits as follows:
  105. X.DS I
  106. Xargument | RTSXOFF | CTSXON    argument | RTSXOFF | CTSXON 
  107. X---------+---------+---------  ---------+---------+---------
  108. X  off    |   0     |   0         0      |   0     |   0
  109. X  on     |   0     |   1         1      |   0     |   1
  110. X  no     |   0     |   0         2      |   1     |   0
  111. X  yes    |   0     |   1         3      |   1     |   1
  112. X.DE
  113. XUnder SunOS 4.1, only CTS support is provided.  You should read
  114. Xthe termio and zs man pages.  Arguments result in the stated
  115. Xmanipulations of the termio element c_cflag:
  116. X.DS I
  117. Xargument | CRTSCTS    argument | CRTSCTS
  118. X---------+---------  ----------+---------
  119. X  off    |   0           0     |   0
  120. X  on     |   1           1     |   1
  121. X  no     |   0     
  122. X  yes    |   1    
  123. X.DE
  124. X
  125. X.*s 2 "RX : receive via XMODEM/CRC"
  126. X.DS L
  127. Xusage: rx
  128. X.DE
  129. X
  130. XThis command invokes ecurz to receive files from the remote
  131. Xsystem using XMODEM/CRC.
  132. X
  133. XAfter entering the command, you are prompted as to whether
  134. Xor not file CR/LF characters are to be converted to
  135. Xnewlines.  If you are transferring text files from a system
  136. Xwhich contain CR/LF line terminators, you must answer yes
  137. Xto this question.  You should answer no when transferring
  138. Xbinary files, such as executables, .arc files and the like.
  139. XFile transfer progress is presented on a visual display.  To
  140. Xabort the transfer, press your interrupt key (usually DEL
  141. Xunless reset with stty(C)).
  142. X
  143. X
  144. X.*s 2 "RY : receive via YMODEM Batch"
  145. X.DS L
  146. Xusage: ry
  147. X.DE
  148. X
  149. XThis command invokes ecurz to receive files from the remote
  150. Xsystem using YMODEM batch with CRC-16 error correction.  The
  151. XYMODEM is "true YMODEM", not XMODEM-1k.  File transfer
  152. Xprogress is presented on a visual display.  To abort the
  153. Xtransfer, press your interrupt key (usually DEL unless reset
  154. Xwith stty(C)).
  155. X
  156. X
  157. X.*s 2 "RZ : receive via ZMODEM/CRC32"
  158. X.DS L
  159. Xusage: rz
  160. X.DE
  161. X
  162. XThis command invokes ecurz to receive files from the remote
  163. Xsystem using ZMODEM/CRC32.  
  164. XThe remote sender must have been started prior to the
  165. Xexecution of this command.
  166. XFile transfer progress is
  167. Xpresented on a visual display.  
  168. XTo abort the transfer, press
  169. Xyour interrupt key (usually DEL unless reset with stty(C)).
  170. X
  171. XIf automatic ZMODEM frame detection is enabled and
  172. XECU is in the interactive mode,
  173. Xthis command is executed automatically.
  174. XAutomatic ZMODEM frame detection is NOT supported 
  175. Xduring procedure execution.
  176. X
  177. X
  178. X.*s 2 "SDNAME : select screen dump file name"
  179. X.DS L
  180. Xusage: sdname [<filename>]
  181. X.DE
  182. X
  183. XWhen the "cursor 5" key is pressed, the screen contents are
  184. Xdumped to a file.  By default, this file is named '~/.ecu/screen.dump'.
  185. XThis command either displays or changes the current screen
  186. Xdump file name, depending upon whether or not a argument
  187. Xis supplied.
  188. X
  189. XThe actions of this command have no effect on the
  190. Xoperation of the
  191. X.b scrdump
  192. Xprocedure command.
  193. X
  194. XSee the section titled "Screen Dump" for more information.
  195. X
  196. X.*s 2 "SK : send via C-Kermit"
  197. X.DS L
  198. Xusage: sk [<file-list>]
  199. X.DE
  200. X
  201. XThis command invokes C-Kermit to
  202. Xsend
  203. Xfiles. ECU searches the PATH list for 'kermit' or 'ckermit',
  204. Xexpecting to find Columbia University C-Kermit version 5A(173)
  205. Xor later.  The file ~/.kermrc must be set up to have any desired
  206. Xinitialization parameters you desire (refer to C-Kermit
  207. Xdocumentation for more information).
  208. XThe remote protocol must have been started prior to the
  209. Xexecution of this command.
  210. X
  211. XWARNING: until further notice, avoid suspending Kermit
  212. Xwith ^\Z.  ECU is totally unprepared to act as a job control
  213. Xprocess group leader.
  214. X
  215. XAfter entering the command, you are prompted as to whether
  216. Xor not file newline characters are to be converted to CR/LF.
  217. XIf you are transferring text files to a system which
  218. Xrequires CR/LF line terminators, you must answer yes to this
  219. Xquestion.  You should answer no when transferring binary
  220. Xfiles, such as executables, .arc files and the like.  You
  221. Xare prompted to enter a list of files to send, which may
  222. Xcontain one or more wildcard specifications.
  223. X
  224. X.*s 2 "SS : send via SEAlink"
  225. X.DS L
  226. Xusage: ss [<file-list>]
  227. X.DE
  228. X
  229. XThis command invokes a SEAlink file transmission protocol.
  230. X.DS L
  231. X
  232. X .--[ Send SEAlink ]-------- dir: /u1/src/ecu ------------------.
  233. X |                                                              |
  234. X |  File(s) to send:                                            |
  235. X |  ___________________________________________________________ |
  236. X |                                                              |
  237. X |    TAB:next  ^B:prev  END:perform transfer  ESC:abort        |
  238. X `-- enter file(s) to send -------------------------------------'
  239. X.DE
  240. X
  241. X.*s 2 "STat : verbose status summary"
  242. X.DS L
  243. Xusage: stat
  244. X.DE
  245. X
  246. XThis command displays comprehensive status and statistics.
  247. XExample display:
  248. X.DS L
  249. X % stat
  250. XDate: 08-17-1992 05:47:49 (UTC 09:47)
  251. XCommunications line: /dev/tty2b 9600-N-1 
  252. XXON/XOFF input on output on
  253. XHardware flow control configuration:
  254. XRTSFLOW off CTSFLOW off CRTSFL off
  255. XNot connected to a remote
  256. XDuplex: full  DCD watcher: off
  257. XConsole: /dev/ttyp7 80x43 <pty>
  258. XAcquired by ecuungetty: /dev/tty2b
  259. XCurrent directory: /u1/src/ecu
  260. XTotal chars transmitted: 234 (since CONNECT 142)
  261. XTotal chars received:    2278 (since CONNECT 1478)
  262. XNo function key set loaded
  263. XSession logging not active
  264. XBell notify is ON
  265. XCR conversion:  incoming CR  outgoing CR
  266. XKeyboard ESC/funckey time constant = 300 msec
  267. XPids: xmtr=20878 rcvr=20882 parent=19476 pgrp=19476
  268. X.DE
  269. X
  270. X.*s 2 "SX : send via XMODEM/CRC"
  271. X.DS L
  272. Xusage: sx [<file-name>]
  273. X.DE
  274. X
  275. XThis command invokes ecusz to send a file to the remote
  276. Xsystem using XMODEM/CRC.
  277. X
  278. XAfter entering the command, you are prompted as to whether
  279. Xor not file CR/LF characters are to be converted to
  280. Xnewlines.  If you are transferring text files from a system
  281. Xwhich contain CR/LF line terminators, you must answer yes
  282. Xto this question.  You should answer no when transferring
  283. Xbinary files, such as executables, .arc files and the like.
  284. X
  285. XYou are prompted to enter a filename to send.  File transfer
  286. Xprogress is presented on a visual display.  To abort the
  287. Xtransfer, press your interrupt key (usually DEL unless reset
  288. Xwith stty(C)).
  289. X.DS L
  290. X .--[ Send XMODEM/CRC ]----- dir: /u1/src/ecu -----------.
  291. X |                                                       |
  292. X |  File to send:                                        |
  293. X |  ____________________________________________________ |
  294. X |                                                       |
  295. X |  Binary: Y (no NL-CR/LF translation)                  |
  296. X |                                                       |
  297. X |   TAB:next  ^B:prev  END:perform transfer  ESC:abort  |
  298. X `-- enter file(s) to send ------------------------------'
  299. X.DE
  300. X
  301. X.*s 2 "SY : send via YMODEM Batch"
  302. X.DS L
  303. Xusage: sy [<file-list>]
  304. X.DE
  305. X
  306. XThis command invokes ecusz to send file(s) to the remote
  307. Xsystem using YMODEM/CRC.
  308. X
  309. XYou are prompted to enter filename(s) to send, which may
  310. Xconsist of one or more wildcard specifications.  File
  311. Xtransfer progress is presented on a visual display.  To
  312. Xabort the transfer, press your interrupt key (usually DEL
  313. Xunless reset with stty(C)).
  314. X.DS L
  315. X .--[ Send YMODEM/CRC ]----- dir: /u1/src/ecu -----------.
  316. X |                                                       |
  317. X |  File to send:                                        |
  318. X |  ____________________________________________________ |
  319. X |                                                       |
  320. X |  Binary: Y (no NL-CR/LF translation)                  |
  321. X |                                                       |
  322. X |   TAB:next  ^B:prev  END:perform transfer  ESC:abort  |
  323. X `-- enter file(s) to send ------------------------------'
  324. X.DE
  325. X
  326. X.*s 2 "SZ : send via ZMODEM/CRC32"
  327. X.DS L
  328. Xusage: sz [<file-list>]
  329. X.DE
  330. X
  331. XThis command sends files to the remote system using ZMODEM/CRC32.
  332. XThe remote receiver must have been started prior to the
  333. Xexecution of this command unless the remote has automatic
  334. XZMODEM frame detection.
  335. X
  336. XYou are prompted to enter filename(s) to send, which may
  337. Xconsist of one or more wildcard specifications.  File
  338. Xtransfer progress is presented on a visual display.  To
  339. Xabort the transfer, press your interrupt key (usually DEL
  340. Xunless reset with stty(C)).
  341. X
  342. XNote: not all ZMODEM receiving software supports transfer of only
  343. Xnewer files or of resuming interrupted transfers.  If the remote
  344. Xreceiver does not support the feature, it may skip (reject) all
  345. Xyour files.  Retry the transfer specifying 'N' to 'Transfer only
  346. Xnewer files' and/or 'Resume interrupted transfer'.
  347. X
  348. X.pp
  349. X.DS L
  350. X.--[ Send ZMODEM/CRC32 ]--- dir: /tmp ---------------------------.
  351. X|                                                                |
  352. X|  File(s) to send:                                              |
  353. X|  ckermit-5a-130                                                |
  354. X|                                                                |
  355. X|  Binary: Y (no NL-CR/LF translation)                           |
  356. X|  Overwrite destination files: Y                                |
  357. X|  Send full pathames:  N                                        |
  358. X|  Transfer only newer files:   N                                |
  359. X|  Resume interrupted transfer: N                                |
  360. X|  Window size: 0                                                |
  361. X|                                                                |
  362. X|     TAB:next  ^B:prev  END:perform transfer  ESC:abort         |
  363. X`-- enter file(s) to send ---------------------------------------'
  364. X`-- Y: no conversion, N: NLs converted to CR/LF -----------------'
  365. X`-- Y: overwrite, N: protect destination files ------------------'
  366. X`-- Y: full pathnames, N: strip directory portion from names ----'
  367. X`-- Y: resume transfer at remote file EOF, N send all -----------'
  368. X`-- Y: send only if source newer than destination, N send all ---'
  369. X`-- window size (max bytes sent before ACK required) 0 = stream -'
  370. X.DE
  371. X
  372. X.*s 2 "TIme : time of day"
  373. X.DS L
  374. Xusage: time
  375. X.DE
  376. X
  377. XThis command displays the local date and time as well as the
  378. Xcurrent UTC.
  379. X
  380. X.*s 2 "TTy : console tty name"
  381. X.DS L
  382. Xusage: tty
  383. X.DE
  384. X
  385. XThis command displays the current console tty name.
  386. X
  387. X
  388. X.*s 2 "XA : hex to ascii char"
  389. X.DS L
  390. Xusage: xa [<hex-val>]
  391. X.DE
  392. X
  393. X<hex-val> is a hexadecimal value between 0 and FF; the
  394. Xparity (sign) bit is stripped and the equivalent ASCII
  395. Xcharacter value is displayed.
  396. X
  397. XIf no argument is supplied, a table of control characters
  398. Xis printed containing decimal, octal, hex, ASCII identifiers
  399. Xand two-character control character identifier.
  400. X
  401. X
  402. X.*s 2 "XON : xon/xoff flow control"
  403. X.DS L
  404. Xusage: xon [<arg>]
  405. Xwhere <arg> is on    input and output flow control
  406. X               off   no flow control
  407. X               in    input flow control
  408. X               out   output flow control
  409. X.DE
  410. X
  411. XThis command enables or disables xon/xoff flow control.
  412. XIf the argument is omitted, the current flow control state is displayed.
  413. X
  414. X.*s 2 "! : execute shell"
  415. X.DS L
  416. Xusage: !
  417. X       !<command>
  418. X.DE
  419. X
  420. XThe '!' command is a shell escape.  The environment variable
  421. XSHELL is read to determine what shell program to execute
  422. X(e.g., /bin/sh, etc).  If '!' is entered by itself, an
  423. Xinteractive shell is started; press ^D to exit back to ECU.
  424. XIf <command> is supplied, it is executed by the shell with
  425. Xan immediate return to ECU.
  426. X
  427. SHAR_EOF
  428. echo 'File doc/_icmd.txt is complete' &&
  429. chmod 0644 doc/_icmd.txt ||
  430. echo 'restore of doc/_icmd.txt failed'
  431. Wc_c="`wc -c < 'doc/_icmd.txt'`"
  432. test 38646 -eq "$Wc_c" ||
  433.     echo 'doc/_icmd.txt: original size 38646, current size' "$Wc_c"
  434. rm -f _shar_wnt_.tmp
  435. fi
  436. # ============= doc/_intro.txt ==============
  437. if test -f 'doc/_intro.txt' -a X"$1" != X"-c"; then
  438.     echo 'x - skipping doc/_intro.txt (File already exists)'
  439.     rm -f _shar_wnt_.tmp
  440. else
  441. > _shar_wnt_.tmp
  442. echo 'x - extracting doc/_intro.txt (Text)'
  443. sed 's/^X//' << 'SHAR_EOF' > 'doc/_intro.txt' &&
  444. X.*s 1 "Introduction"
  445. X
  446. XECU (Extended Call Utility) is a personal and research
  447. Xcommunications program originally written for
  448. Xusers of SCO UNIX V.3.2/386 and XENIX V on 80286 and 80386 systems.
  449. XSupport for other systems has been added and further porting
  450. Xis possible with "minor" effort to other systems based on or
  451. Xsimilar to UNIX System V.
  452. XThis preliminary document describes ECU functionality and implementation
  453. Xfrom a technical point of view and provides at least rudimentary
  454. Xdocumentation for its features and commands.
  455. X
  456. XECU provides the classic terminal communications facility of passing
  457. Xkeyboard data to a serial line and incoming data to the computer video
  458. Xdisplay.  In addition, a dialing directory, a function key mapping
  459. Xfeature, and session logging are available.
  460. X
  461. XA very flexible procedure (script) language is also incorporated to
  462. Xautomate many communications tasks.  In addition to
  463. Xaugmenting interactive tasks, by using shell scripts and ECU
  464. Xprocedures, ECU can perform batch-style communications sessions
  465. Xin an entirely "unattended" fashion.
  466. XBecause of limitations of my nroff program, the procedure language
  467. Xis described in a separate document.
  468. X
  469. XECU presents to the host a flexible "ANSI" terminal type, accepting
  470. Xany valid video control sequences from MS-DOS or SCO documentation
  471. Xas of late 1990.  It also fares well, though imperfectly, with
  472. XSun and VT-100 in-band video control sequences.
  473. XStandards are great: everybody should have one, especially if
  474. Xthey call it "ANSI."
  475. XFor more information,
  476. Xrefer to the section below titled "ANSI Filter."
  477. X
  478. XThe program supports almost any local terminal (console) which
  479. Xcan be described in a termcap database entry.
  480. XFor more information, refer to "Supported Terminals."
  481. X
  482. XECU supports numerous file transfer protocols: as of this writing,
  483. XXMODEM, XMODEM/CRC, XMODEM-1K, YMODEM/CRC Batch, ZMODEM/CRC-16,
  484. XZMODEM/CRC-32, Kermit and SEAlink are supported.
  485. XFor more information, refer to the sections describing the
  486. Xindividual interactive and procedure file transfer commands.
  487. X
  488. XThis document is better than that supplied with
  489. XECU 2.0, but is still rough in many places.
  490. XIt attempts to get across to the inquiring mind how ECU
  491. Xworks.  In places, an understanding of the UNIX programming model, UNIX,
  492. XXENIX and UUCP constructs and asynchronous communications techniques
  493. Xis assumed.  In other places, the document goes into tedious detail
  494. Xabout the simplest of concepts.  A great deal of attention has been
  495. Xplaced in accurate and robust coding of the program.  Perhaps, time
  496. Xpermitting, one day I can say the same for this document.
  497. SHAR_EOF
  498. chmod 0644 doc/_intro.txt ||
  499. echo 'restore of doc/_intro.txt failed'
  500. Wc_c="`wc -c < 'doc/_intro.txt'`"
  501. test 2580 -eq "$Wc_c" ||
  502.     echo 'doc/_intro.txt: original size 2580, current size' "$Wc_c"
  503. rm -f _shar_wnt_.tmp
  504. fi
  505. # ============= doc/_p_cmd.txt ==============
  506. if test -f 'doc/_p_cmd.txt' -a X"$1" != X"-c"; then
  507.     echo 'x - skipping doc/_p_cmd.txt (File already exists)'
  508.     rm -f _shar_wnt_.tmp
  509. else
  510. > _shar_wnt_.tmp
  511. echo 'x - extracting doc/_p_cmd.txt (Text)'
  512. sed 's/^X//' << 'SHAR_EOF' > 'doc/_p_cmd.txt' &&
  513. X.*s 1 "Commands"
  514. X
  515. X.*s 2 "autorz"
  516. X
  517. Xusage: autorz [off | on]
  518. X
  519. XECU in the interactive mode (no procedure executing) can interpret a
  520. XSUB, 'B', '0', '0' receive data sequence as a ZMODEM ZRQINIT frame and
  521. Xautomatically begin a ZMODEM receive operation.  This command controls
  522. Xthis feature.  By default, this feature is turned on.
  523. X
  524. X.*s 2 "baud"
  525. X
  526. Xusage: baud <baud-int>
  527. X
  528. XThis command sets the baud rate for the attached line.
  529. XThe integer argument <baud-int> must be one of
  530. X110, 300, 600, 1200, 2400, 4800, 9600, 19200 and 38400.
  531. X
  532. XUsing the 'baud' procedure command in the ECU initialization
  533. Xprocedure "_rc.ep" serves as an exact analog of the -b command.  The
  534. X.B baud
  535. Xcommand with the
  536. X.B setline
  537. Xcommand gives you programatic control over the actual choice of the
  538. Xline and rate or the defaults for the setup screen, depending upon
  539. Xother options.  NOTE: using the baud command in _rc.ep will override
  540. Xany command line -b specification.
  541. X
  542. X.DS L
  543. XExample:
  544. X    baud 9600
  545. X    set $i0=2400; baud $i0
  546. X.DE
  547. X
  548. X.*s 2 "break"
  549. X
  550. Xusage: break
  551. X
  552. XThis command is used inside a
  553. X.B whilei
  554. Xor
  555. X.B whiles
  556. Xcompound statement to exit the loop.
  557. X
  558. XThis is not to be confused with the interactive command
  559. X"break" when sends an asynchronous BREAK signal.  Use the procedure
  560. Xcommand 
  561. X.B lbreak
  562. Xfor this purpose.
  563. X
  564. X.DS L
  565. XExample:
  566. X
  567. X    whilei 1=1 #forever unless break command executed
  568. X    {
  569. X        echo -n 'Answer yes or no: '
  570. X        set $s0=%cgets # get answer
  571. X        ifi %instr($s0,'y') == 0 set $i0 = 1; break
  572. X        ifi %instr($s0,'n') == 0 set $i0 = 0; break
  573. X        # got neither 'y' nor 'n' ... keep trying
  574. X    }
  575. X    # now $i0 = 1 if yes, 0 if no
  576. X.DE
  577. X
  578. XNOTE: further examples of
  579. X.B break
  580. Xusage may be found in the example for the
  581. Xelse
  582. Xcommand.
  583. X
  584. X.*s 2 "cd"
  585. X
  586. Xusage: cd <directory-path>
  587. X
  588. XThis command changes ECU's current working directory.
  589. XThe string argument <directory-path> may contain any
  590. Xdirectory pathname specification legal to be submitted to
  591. Xthe shell csh.  Wild card characters may be used, provided
  592. Xthe expansion produces only one pathname.
  593. X
  594. X.DS L
  595. XExample:
  596. X
  597. X    cd '~user/bin'
  598. X    cd %envvar('HOME')+'/bin'
  599. X.DE
  600. X
  601. X.*s 2 "clrx"
  602. X
  603. Xusage: clrx
  604. X
  605. XThis command clears  the attached line's transmitter XOFF state.
  606. XIssuing the command is the equivalent to receiving an XON from
  607. Xthe remote system.
  608. X
  609. X.*s 2 "cls"
  610. X
  611. Xusage: cls
  612. X
  613. XThis command clears the screen.
  614. X
  615. X.*s 2 "color"
  616. X
  617. X.DS L
  618. Xusage: color <normal-foreground> [<normal-background>]
  619. Xusage: color -r <reverse-foreground> [<reverse-background>]
  620. X.DE
  621. X
  622. XThis command changes the current normal or reverse video colors in a
  623. Xmanner similar to the setcolor(C) command.  It has no effect on systems
  624. Xusing other than an SCO multiscreen color monitor.  
  625. XIf the second (background) color is
  626. Xomitted, it is assumed to be black.
  627. X
  628. XThe command also forces normal video mode.  Refer to the
  629. X.B vidnorm
  630. Xand
  631. X.B vidrev
  632. Xcommands.
  633. XRefer also to the
  634. X.B vidcolor
  635. Xcommand.
  636. X
  637. X.DS L
  638. XColor names
  639. X   blue      magenta      brown      black
  640. X   lt_blue   lt_magenta   yellow     gray
  641. X   cyan      white        green      red
  642. X   lt_cyan   hi_white     lt_green   lt_red
  643. X.DE
  644. X.DS L
  645. XExample:
  646. X
  647. X    color lt_green  # normal video light green on black
  648. X    color -r red white # reverse video red on white
  649. X.DE
  650. X
  651. X.*s 2 "continue"
  652. X
  653. Xusage: continue
  654. X
  655. XThis command is used inside a
  656. X.B whilei
  657. Xor
  658. X.B whiles
  659. Xcompound statement to skip the remainder of any
  660. Xcommands in the loop and continue execution at the first
  661. Xcommand in the loop.
  662. X.DS L
  663. XExample:
  664. X
  665. X    send '' # send ENTER to get prompt
  666. X    whilei 1=1 # forever unless break command executed
  667. X    {
  668. X        lookfor -e 'login: ' # look for login prompt
  669. X        ifi $i0 == 0         # if we dont get prompt ...
  670. X        {
  671. X            send ''          # send ENTER again
  672. X            continue         # and look for login prompt
  673. X        }
  674. X        send $s_name         # send username
  675. X        lookfor -e 'Password:'
  676. X        send $s_password
  677. X        get -e 0 50          # wait 10 seconds for response
  678. X
  679. X        # if incorrect not found in response, ...
  680. X        if %instr($s0,'incorrect') < 0 # ... must have won
  681. X            break
  682. X
  683. X        # garbled line?: system will send another 'login: '
  684. X    }
  685. X
  686. X.DE
  687. X
  688. XNOTE: further examples of
  689. X.B continue
  690. Xusage may be found in the example for the
  691. X.B else
  692. Xcommand.
  693. X
  694. X.*s 2 "cursor"
  695. X
  696. Xusage: cursor <row> [<col>]
  697. X
  698. XThis command places the cursor at a specified position on
  699. Xthe video screen.  The top left of the scrren is row 0, column 0.
  700. XIf <col> is not specified, it is assumed 0 (left margin).
  701. X.DS L
  702. XExample:
  703. X
  704. X    cls
  705. X    $i0 = 5
  706. X    whilei $i5 < 12
  707. X    {
  708. X        cursor $i5
  709. X        echo 'This is line '+%itos($i5,2d)+' of the display'
  710. X    }
  711. X.DE
  712. X
  713. X.*s 2 "dcdwatch"
  714. X
  715. Xusage: dcdwatch [<dcdwatch-param>]
  716. X
  717. XThis command controls the DCD watcher.  The optional argument may be:
  718. X.DS L
  719. X   y or yes         enable DCD watcher
  720. X   n or no          disable DCD watcher
  721. X   t or terminate   terminate ECU on loss of DCD
  722. X.DE
  723. X
  724. XThe DCD watcher when enabled causes ECU to monitor the DCD line
  725. X(within the limits imposed by the OS with its CLOCAL=0 functionality).
  726. XWhen the watcher is on and DCD drops, ecu automatically performs
  727. Xthe action of the interactive or procedure
  728. X.B hangup
  729. Xcommand.  If the 't'erminate option is chosen, then after
  730. Xhangup processing is complete, the ECU program will terminate.  
  731. X
  732. XThe state of the watcher may be changed by the use of the dial
  733. Xcommand which uses a directory entry which changes the
  734. XDCD watcher status.
  735. X
  736. XThe DCD watcher depends upon the tty driver to return zero characters
  737. Xon a read when DCD is low when the termio flag CLOCAL is reset.
  738. XThe tty driver must ignore DCD if CLOCAL is set.
  739. XIf your system offers a "modem" and "direct" choice (by choice
  740. Xof filename), you probably need to use the "modem" choice for
  741. Xthis to work properly.  This decision is made properly for you
  742. Xon SCO if you are using SCO "standard" tty line
  743. Xnaming conventions.  This is true even though ECU appears to force
  744. Xa tty name with trailing upper case characters (modem) to 
  745. Xone with a lower case character (direct).
  746. X
  747. X.*s 2 "delline"
  748. X
  749. Xusage: delline
  750. X
  751. XThis command deletes the current line from the video display.
  752. X
  753. X.*s 2 "dial"
  754. X
  755. Xusage: dial <remote>
  756. X
  757. XThis command causes an outgoing call to be placed.  The string
  758. Xargument <remote> can take one of two forms: a numeric telephone
  759. Xnumber or an alphanumeric "logical" number or system name.
  760. X
  761. XA numeric phone number ('1(800)555-1212' or '2345678') must begin
  762. Xwith a digit and must consist entirely of digits, parentheses
  763. Xor hyphens.
  764. XIf a telephone number is supplied, the phone number is
  765. Xdialed; you must first have set the desired baud rate and
  766. Xparity using the 'baud' and 'parity' commands.
  767. X(If the last character of a telephone number is a dollar sign,
  768. Xit is removed and is replaced with the contents of the first line
  769. Xin ~/.ecu/credit.  See the description of the dialing directory.)
  770. X
  771. XIf a logical name is entered, the phone directory (managed by
  772. Xthe interactive
  773. X.B dial
  774. Xcommand) is searched;
  775. Xif the entry is found, the baud rate and parity
  776. Xis automatically set from values in the directory entry; then,
  777. Xthe number in the directory entry is dialed.
  778. X
  779. XUsing the dial command with a directory entry may change the 
  780. XDCD watcher (dcdwatch) status.
  781. XSee the section on the
  782. X.B dcdwatch
  783. Xcommand and the section titled "Choosing a Dialout Line" for
  784. Xmore information.
  785. X
  786. XWhen the
  787. X.B dial
  788. Xcommand returns, integer variable $i0 is set to a status code
  789. Xand string variable $s0 has a text message (the modem verbal
  790. Xresult code if the ECU dialer is used, a representation of
  791. Xthe return status code if a uucp dialer is used [see below]).
  792. X.DS L
  793. X.B
  794. XDial Command $i0 Status Codes
  795. X.R
  796. X
  797. X    0  successful connect
  798. X    1  failed to connect (call progress)
  799. X    2  dial interrupted by signal
  800. X    3  modem error (non responsive or commands rejected)
  801. X.DE
  802. X.DS L
  803. X.B
  804. XDial Command $s0 Status Messages (uucp dialer)
  805. X.R
  806. X
  807. X    CONNECT ####           #### = baud rate
  808. X    BUSY                   only some modems
  809. X    NO ANSWER              only some modems
  810. X    NO CARRIER             most generic "fail to connect"
  811. X    NO DIAL TONE           only some modems
  812. X    !Connect bad baud rate modem reported different rate
  813. X    !Interrupted           call interrupted by signal
  814. X    !Invalid arguments     ECU error
  815. X    !Invalid phone number  too long or bad characters
  816. X    !Ioctl error           should not be reported here
  817. X    !Line in use           should not be reported here
  818. X    !Line open error       should not be reported here
  819. X    !Modem Error           modem did not respond
  820. X
  821. XNote: if the ECU dialer is used, the actual modem result code
  822. Xis returned in $s0 or one of the following two strings:
  823. X
  824. X    !Interrupted           call interrupted by signal
  825. X    !Modem Error           modem did not respond
  826. X.DE
  827. X
  828. X.*s 2 "do"
  829. X
  830. Xusage: do <procname> [<arg> ...]
  831. X
  832. XThis command executes a procedure whose name appears as the command's
  833. Xfirst (string) argument.  One or more arguments (up to 19) may be passed
  834. Xto the called procedure; an argument may consist of any valid string
  835. Xexpression, provided, that, when expanded,  the argument does not
  836. Xexceed 256 characters in length.
  837. X
  838. XThe called procedure may read its arguments using the
  839. X.B %argv
  840. Xstring function.  %argv(0) is the name of the procedure.
  841. XThe quantity of arguments may be obtained using the
  842. X.B %argc
  843. Xinteger function.
  844. X
  845. X.DS L
  846. XExample:
  847. X
  848. X    do 'proc' %rname %date+' '+%time %argv(0)
  849. X
  850. XNote: in this example, the called procedure is passed the name
  851. Xof the calling procedure as the last argument.
  852. X.DE
  853. X
  854. X.*s 2 "duplex"
  855. X
  856. X.DS L
  857. Xusage: duplex full | half
  858. X       duplex 'full' | 'half'
  859. X.DE
  860. X
  861. XThis command specifies whether or not ECU is to locally echo
  862. Xcharacters typed by you at the keyboard.  The overwhelming
  863. Xmajority of remote systems provide the echo function, in
  864. Xwhich case full duplex must be used.  For the rare occasions
  865. Xwhen the remote system does not echo your keyboard input,
  866. Xsetting half duplex will allow you to see what you are
  867. Xtyping.
  868. X
  869. XWhen communicating with another terminal in a "teletype
  870. Xconversation", setting half duplex is generally required.
  871. XIn such cases, use of the interactive
  872. X.B nl ,
  873. X.B nlin
  874. Xand
  875. X.B nlout
  876. Xcommands may also be required.
  877. X.DS L
  878. XExample:
  879. X
  880. X    duplex full
  881. X    $s0 = 'full'; duplex $s0
  882. X.DE
  883. X
  884. X
  885. X.*s 2 "echo"
  886. X
  887. Xusage: echo [-n] <string>
  888. X
  889. XThis command prints the contents of the string argument <string>
  890. Xon the screen.  If the -n switch is not present, a newline follows
  891. Xthe output of <string>.
  892. X.DS L
  893. XExample:
  894. X
  895. X    echo 'Procedure '+%argv(0)+' executing at '+%time
  896. X    echo -n 'Enter your first name: '; $s0 = %cgets
  897. X.DE
  898. X
  899. X.*s 2 "eeol"
  900. X
  901. Xusage: eeol
  902. X
  903. XThis command erases the video display to the end of the line.
  904. X
  905. X.*s 2 "else"
  906. X
  907. X.DS L
  908. Xusage: else <statement>
  909. X
  910. X       else
  911. X           <statement>
  912. X
  913. X       else
  914. X       {
  915. X            any kind and number of statements
  916. X       }
  917. X
  918. X       else <if> <statement>
  919. X
  920. X       else <if>
  921. X       {
  922. X            any kind and number of statements
  923. X       }
  924. X
  925. X.DE
  926. X
  927. XThis statement may follow an
  928. X.B ifi
  929. Xor
  930. X.B ifs 
  931. Xcommand to specify one or more statements to be executed if
  932. Xthe if-type command condition is false.  Else commands may be
  933. Xchained together in the traditional structured language manner.
  934. X
  935. XFor the purposes of describing this command, <statement> is
  936. Xany single or compound statement
  937. X.B NOT
  938. Xcontaining a
  939. X.B whilei
  940. Xor
  941. X.B whiles
  942. Xcommand.
  943. XIf you wish to have a while-type command executed as part of an
  944. X.B else
  945. Xcondition, the while must occur within braces ("{}").
  946. X
  947. X<if> is an
  948. X.B ifi
  949. Xor
  950. X.B ifs
  951. Xcommand followed by an <if-condition> (see the description of the
  952. X.B ifi
  953. Xor
  954. X.B ifs
  955. Xcommands below).
  956. X.DS L
  957. XExample:
  958. X
  959. X#+------------------------------------------------------
  960. X# finger.ep - procedure to send 'finger' to remote
  961. X# BSD Unix system; print resulting lines in different
  962. X# colors: uucp logins green, root red, others cyan
  963. X#-------------------------------------------------------
  964. X
  965. X    mkvar $icolor; $icolor = %colors
  966. X    mkvar $itimeout
  967. X    $itimeout = 50     # timeout for first line 5 secs
  968. X    send 'ps -aux'     # send command, but do not echo
  969. X    lookfor '\en' 40    # swallow command
  970. X    whilei 1==1        # forever, or until break
  971. X    {
  972. X        lgets 0 $itimeout 1 '\en' #get a line
  973. X        ifi $i0 = 0 break #if no chaacters read
  974. X        $itimeout = 10 #wait 1 sec for later lines
  975. X
  976. X        ifi %instr($s0,'% ') >= 0 # if csh prompt seen
  977. X            break                 # exit while loop
  978. X        else ifi %instr($s0,'Login') >= 0
  979. X            color gray
  980. X        else ifi %instr($s0,'root') >= 0
  981. X            color red
  982. X        else ifi %instr($s0,'uucp') >= 0
  983. X            color green
  984. X        else color cyan
  985. X        echo $s0
  986. X    }
  987. X    icolor $icolor #restore entry colors
  988. X    send ''        #force a new prompt from remote
  989. X
  990. X.DE
  991. X
  992. X.*s 2 "exec"
  993. X
  994. Xusage: exec <string>
  995. X
  996. XThis function executes a string as a procedure statement.
  997. XArgument <string> must contain an ecu statement exactly as
  998. Xmight appear on a procedure line, with a few exceptions.
  999. X
  1000. X.DS L
  1001. X1. There may be no label: the first command may 
  1002. X   start in column one.
  1003. X2. You should not execute a goto, gosub or return.
  1004. X3. You should not code if, while or compound statement
  1005. X   brackets.
  1006. X.DE
  1007. X
  1008. XYou are on your honor with regard to items 2 and 3 above.
  1009. XIf you stretch it, it will break.
  1010. X
  1011. X.DS L
  1012. XExample:
  1013. X
  1014. X    $s20 = 'Home';   $s30 = '^H' 
  1015. X    $s21 = 'End';    $s31 = '^E'
  1016. X    $s22 = 'F1';     $s32 = '^A'
  1017. X    $s23 = 'F2';     $s33 = '^B'
  1018. X    $i10 = 0
  1019. X    whilei $i0 < 4
  1020. X    {
  1021. X        $s0 = 'fkmap '+$s[20+$i10]+' '+$s[30+$i10]
  1022. X        exec $s0
  1023. X        $i10 = $i10 + 1
  1024. X    }
  1025. X.DE
  1026. X        
  1027. X.*s 2 "exit"
  1028. X
  1029. Xusage: exit [<status>]
  1030. X
  1031. XThis command causes an abrupt termination of the ECU program.
  1032. XAny existing connection with a remote system
  1033. Xis terminated immediately.
  1034. XIf no integer argument <status> is found, ECU exits
  1035. Xwith a program exit status of 0.
  1036. XIf <status> is found and the value is zero, then ECU exits
  1037. Xwith a program exit status of 0.
  1038. XIf <status> non-zero,its value must be in the range of 1 to 31,
  1039. Xand ECU exits
  1040. Xwith a program exit status of 192 plus <status>.
  1041. XThis feature allows batch executions of ECU by shell script
  1042. Xto detect user-determined ECU execution status.
  1043. XSee the section titled "Exit Codes".
  1044. X
  1045. X.*s 2 "expresp"
  1046. X
  1047. Xusage: expresp [-v[v...]] <exp-resp-str> [<timeout_msecs>]
  1048. X
  1049. XThis command emulates the uuchat function as described in the
  1050. XSCO HDB UUCP documentation and in the /usr/lib/uucp/Dialers
  1051. Xfile.
  1052. X
  1053. X-v causes the expect-respond conversation between ECU and the
  1054. Xremote system to be displayed on the screen.  This switch is
  1055. Xautomatically enabled if procdedure tracing is enabled.
  1056. X
  1057. XMultiple v's (e.g., -vv, -vvv) up to 3 'v's produce
  1058. Xmore verbose debug output. -vv causes each base level
  1059. Xexpect and respond string to be displayed. -vvv causes
  1060. Xa hexadecimal dump of each  interpreted expect string to be
  1061. Xdisplayed.
  1062. X
  1063. XThe majority of procedure tracing features use the current trace
  1064. Xstate (from the
  1065. X.B ptrace
  1066. Xcommand setting) as a binary condition.  That is, either tracing is done
  1067. Xor not.  However,
  1068. X.B expresp
  1069. Xadds the tracing level to the number of -v switches to determine its
  1070. Xverbosity level.
  1071. X
  1072. XEscape sequences allow you to insert special or variable
  1073. Xinformation in your expect and respond strings.  Escape sequences
  1074. Xbegin with either the backslash or the tilde.  NOTE: remember to
  1075. Xuse two backslashes inside a literal string constant to get one
  1076. Xbackslash in the resulting string.  The procedure language's
  1077. Xstring parser has it's own use for a single backslash followed by
  1078. Xanother character.  For instance:
  1079. X
  1080. X.DS L
  1081. X    set $s0='\e\eM' sets $s00 to '\eM'
  1082. X.DE
  1083. X
  1084. XSome of the escape sequnces have meaning in both expect and respond
  1085. Xtokens while others have a use in only of of the two types.
  1086. X
  1087. X.DS L
  1088. X   Meaning of the escape sequences:
  1089. X   \eD - current phone number
  1090. X   \eE - turn on echo checking when sending (for slow devices)
  1091. X   \eK - send a BREAK
  1092. X   \eM - turn on line CLOCAL 
  1093. X   \eN - null byte (same as \e000)
  1094. X   \eT - current phone number with Dialcodes and
  1095. X         character translation
  1096. X   \ec - append no new-line to send string (must be last
  1097. X            "character" in a send string)
  1098. X   \ed - delay (2 seconds) 
  1099. X   \ee - turn off echo checking when sending
  1100. X   \em - turn off line CLOCAL 
  1101. X   \en - send or expect new-line
  1102. X   \ep - pause (approximately 1/4-1/2 second delay)
  1103. X   \er - send or expect carriage return
  1104. X   \e\e - send or expect backslash (same as \e134)
  1105. X   \e~ - send or expect tilde (same as \e176)
  1106. X   \e### - send or expect character respresenting three
  1107. X           character octal value ### (*MUST* be three digits
  1108. X           with leading zeroes as necessary)
  1109. X   ~m[##] - set expect timeout to ## milliseconds (NOT
  1110. X            SUPPORTED BY DIALERS; SEE BELOW)
  1111. X   ~n[##] - nap ## milliseconds (NOT SUPPORTED BY DIALERS;
  1112. X           SEE BELOW)
  1113. X   ~t[##] - set expect timeout to ## seconds (NOT SUPPORTED
  1114. X            BY DIALERS; SEE BELOW)
  1115. X   Speed - Hayes-style CONNECT handler (as sole contents of
  1116. X           an expect string, equivalent to using CONNECT)
  1117. X.DE
  1118. X
  1119. X<timeout_msecs> specifies an optional timeout in milliseconds
  1120. Xfor waiting on expect strings;  it defaults to 10,000 milliseconds
  1121. X(10 seconds).
  1122. XThe resolution for timeouts is limited to the basic tick time of
  1123. Xyour system (HZ, 10 msec for UNIX/386 3.2.0,
  1124. X16 (1000/60) msec for 3.2.1 (ODT 1.0) and 3.2v2 (ODT 1.1),
  1125. Xback to 10 msec for 3.2v4 (ODT 2.0) and
  1126. X20 msec for XENIX/386 and XENIX/286). Whew!
  1127. XThe timeout for 'Speed' expects is fixed at 90 seconds.
  1128. X
  1129. X~t[##] and ~m[##] may appear at the beginning of an expect portion
  1130. Xof a script.  They set the expect timeout delay in seconds and
  1131. Xmilliseconds, respectively.  The ## is a decimal number; if it is
  1132. Xspecified <= 0, there will be no delay.  The initial timeout set
  1133. Xfor each execution of the expresp command is 10 seconds.  The
  1134. Xtimeout period remains as you set it for the remainder of the
  1135. Xscript unless you change it again.
  1136. X
  1137. X.DS L
  1138. XExamples:
  1139. X
  1140. X    ~t[20]gin:      look for "gin:" for 20 seconds
  1141. X    ~m[500]\001     look for STX for 500 milliseconds
  1142. X    "" ~t[3]gin:--gin: uname ~t[10]word: secret
  1143. X.DE
  1144. X
  1145. X~n[##] may appear anywhere in a respond portion of a script.  
  1146. XIt causes ECU to nap the number of milliseconds specified
  1147. Xby the decimal ## argument.  This function was served by \em prior
  1148. Xto ECU 3.20.  Addition of SVR4 \eM and \em necessitated
  1149. Xthe change.
  1150. X
  1151. X.DS L
  1152. XExample:
  1153. X
  1154. X    a~n[20]b~n[20]c   send "abc" with 20 msec between each
  1155. X                      character
  1156. X.DE
  1157. X
  1158. X
  1159. XInteger variable $i0 is set to one if the expect-respond script 
  1160. Xfails, else it is set to 0.
  1161. X
  1162. X.*s 2 "fchmod"
  1163. X
  1164. Xusage: fchmod <mode> <filenum>
  1165. X
  1166. XThis command sets the mode of <filenum> to <mode>.
  1167. XThe <mode> argument takes one of two forms, a nine-character
  1168. Xmode string (e.g., 'rwxr-xr-x') or an integer value (0755).
  1169. XThe <filenum> argument is either a string value forming a
  1170. Xfilename or an integer file number representing a file opened with the
  1171. X.B fopen
  1172. Xcommand.
  1173. X
  1174. XThe command sets $i0 = 0 if successful, else to the
  1175. X.B errno
  1176. Xfrom the associated system call (refer to the 
  1177. X.B %errstr
  1178. Xstring function and/or /usr/include/sys/errno.h).
  1179. X
  1180. X.DS L
  1181. XExample:
  1182. X
  1183. X    fopen 1 '/tmp/123'; fchmod 'rwxrwxrwx' 1
  1184. X    fchmod 'rwxrwxrwx' '/tmp/123'
  1185. X    fopen 1 '/tmp/123'; fchmod 0777 1
  1186. X    $i0 = 0777; fchmod $i0 '/tmp/123'
  1187. X
  1188. XAll of the above example result in the same result.
  1189. X.DE
  1190. X
  1191. X.*s 2 "fclose"
  1192. X
  1193. Xusage: fclose <filenum>
  1194. X
  1195. XThis command closes <filenum>.
  1196. XThe <filenum> argument is an
  1197. Xinteger file number representing a file opened with the
  1198. X.B fopen
  1199. Xcommand.
  1200. X
  1201. XThe command is ignored if <filenum> is not open.
  1202. XNo integer variable is modified by
  1203. X.I fclose .
  1204. X
  1205. X.DS L
  1206. XExample:
  1207. X
  1208. X    fclose 1
  1209. X.DE
  1210. X
  1211. X.*s 2 "fdel"
  1212. X
  1213. Xusage: fdel <filenum>
  1214. X
  1215. XThis command removes a file.
  1216. X
  1217. XThe command sets $i0 = 0 if successful, else to the
  1218. X.B errno
  1219. Xfrom the associated system call (refer to the 
  1220. X.B %errstr
  1221. Xstring function and/or /usr/include/sys/errno.h).
  1222. X
  1223. X.DS L
  1224. XExample:
  1225. X
  1226. X    fdel '/tmp/123'
  1227. X.DE
  1228. X
  1229. X.*s 2 "fgetc"
  1230. X
  1231. Xusage: fgetc <filenum> <destination>
  1232. X
  1233. XThis command reads a character from <filenum>.
  1234. XThe <filenum> argument is an
  1235. Xinteger file number representing a file opened with the
  1236. X.B fopen
  1237. Xcommand.
  1238. X
  1239. XThe argument <destination> is either a string variable
  1240. Xor an integer variable.
  1241. XIf the file has reached end of file: an integer variable
  1242. Xreceives -1; a string variable is returned null.
  1243. XOtherwise, the character's numeric value (0-255) is placed
  1244. Xin an integer variable or a string variable is returned with a
  1245. Xlength of one with the file character as its only character.
  1246. X
  1247. X.DS L
  1248. XExample:
  1249. X
  1250. X    fgetc 1 $s0
  1251. X    fgetc 1 $i_input
  1252. X.DE
  1253. X
  1254. X.*s 2 "fgets"
  1255. X
  1256. Xusage: fgets <filenum> <strvar>
  1257. X
  1258. XThis command reads a character from <filenum>.
  1259. XThe <filenum> argument is an
  1260. Xinteger file number representing a file opened with the
  1261. X.B fopen
  1262. Xcommand.
  1263. X
  1264. XThe argument <strvar> is a string variable.
  1265. XIf the file has reached end of file, <strvar> is returned null and
  1266. Xinteger variable $i0 is set to 1.
  1267. XOtherwise, the <strvar> receives input from the file minus
  1268. Xthe trailing newline and $i0 is returned zero.
  1269. X
  1270. X.DS L
  1271. XExample:
  1272. X
  1273. X    fgets 1 $s0
  1274. X.DE
  1275. X
  1276. X.*s 2 "fkey"
  1277. X
  1278. X.DS L
  1279. Xusage: fkey <str>
  1280. X       fkey -r
  1281. X.DE
  1282. X
  1283. XThis command selects a function key definition from the ~/.ecu/keys
  1284. Xfile.  The -r version resets to the original defaults, plust
  1285. Xloads any entry in keys named "default".
  1286. X
  1287. X.*s 2 "fkmap"
  1288. X.DS L
  1289. Xusage: fkmap 
  1290. X       fkmap <keyname>
  1291. X       fkmap <keyname> <keylist>
  1292. X       fkmap -r
  1293. X       fkmap -s <file>
  1294. X.DE
  1295. X
  1296. XThis command manages the mechanism ECU uses to recognize function
  1297. Xkeys when they are entered at the console.  Entering the command
  1298. Xwith no arguments displays the current mapping in funckeymap format.
  1299. X
  1300. XIf supplied, the first argument to the command must be the
  1301. Xrecognized name of a function key from the list:
  1302. X.DS L
  1303. X F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12
  1304. X Home End PgUp PgDn CUP CUL CU5 CUR CUD
  1305. X.DE
  1306. XThe case of the entered argument is unimportant.
  1307. X
  1308. XIf only one argument is supplied, the mapping for the specified key
  1309. Xis displayed.  If more than one argument is supplied, the keyboard
  1310. Xmapping is changed.  Arguments 2-n are character code specifiers
  1311. Xin the format used to define a funckeymap entry.
  1312. X.B WARNING :
  1313. XIf found to be syntactically correct, a mapping change
  1314. Xis installed immediately.  If incorrect mapping of the HOME
  1315. Xkey is requested, you may lose control of ECU.
  1316. X
  1317. XThe -r form rereads the original funckeymap definition (as
  1318. Xat program invocation), reseting the mapping.  The -s switch
  1319. Xsaves the current mapping to <file>.
  1320. X
  1321. XNote: the fkmap command line must contain literal text.
  1322. XNo variable or expression expansions are not done.
  1323. X
  1324. X.DS L
  1325. XExamples:
  1326. X
  1327. X    fkmap f10       display F10 mapping
  1328. X    fkmap Home ^Z   map Home to ^Z
  1329. X                    after this command, type ^Z for Home
  1330. X.DE
  1331. X
  1332. X.*s 2 "flush"
  1333. X
  1334. Xusage: flush
  1335. X
  1336. XThis command causes any characters received by the system
  1337. Xfrom the line, but not yet read by the procedure to be "forgotten"
  1338. Xor flushed.
  1339. X
  1340. X.*s 2 "fopen"
  1341. X
  1342. Xusage: fopen [-<mode>] <filenum> <filename>
  1343. X
  1344. XThis command opens a file named by the string argument <filename>
  1345. Xand associates it with the user-chosen file number <filenum> (which
  1346. Xmust be an integer value between 0 and 4, inclusive).
  1347. X
  1348. XThe argument switches govern how a file is opened and must be chosen
  1349. Xfrom this list:
  1350. X.VL 15 4
  1351. X.LI -r
  1352. XThe file is opened read-only; if it does not
  1353. Xexist, an error occurs.
  1354. X.LI -r+
  1355. XThe file is opened for reading and writing; if it does not
  1356. Xexist, an error occurs.
  1357. X.LI -w
  1358. XThe file is opened for writing (any previous contents
  1359. Xof the file are lost); if it does not
  1360. Xexist, it is created.
  1361. X.LI -w+
  1362. XThe file is opened for reading and writing (any previous contents
  1363. Xof the file are lost); if it does not
  1364. Xexist, it is created.
  1365. X.LI -a
  1366. XThe file is opened for appending (writes to the file
  1367. Xare added to the previous file contents); if it does not
  1368. Xexist, it is created.
  1369. XAll writes are appended to the file (the
  1370. X.B fseek
  1371. Xcommand has no effect).
  1372. X.LE
  1373. X
  1374. XThe switches argument may be omitted; in such cases,
  1375. Xthe file is opened as though '-r' had been supplied.  However,
  1376. Xif procedure tracing is enabled (see the description of the
  1377. Xinteractive and procedure command
  1378. X.B ptrace ),
  1379. Xa warning message will be issued.
  1380. X
  1381. XThe command sets $i0 = 0 if successful, else to the
  1382. X.B errno
  1383. Xfrom the associated system call (refer to the 
  1384. X.B %errstr
  1385. Xstring function and/or /usr/include/sys/errno.h).
  1386. X.DS L
  1387. XExample:
  1388. X
  1389. X    fopen 0 -r '/etc/passwd'
  1390. X    fopen 1 -w+ '/tmp/123'
  1391. X    fopen 2 -a 'tranact.log'
  1392. X.DE
  1393. X
  1394. X.*s 2 "fputc"
  1395. X
  1396. Xusage: fputc <filenum> <char>
  1397. X
  1398. XThis command writes character <char> into <filenum>.
  1399. XThe <filenum> argument is an
  1400. Xinteger file number representing a file opened with the
  1401. X.B fopen
  1402. Xcommand.
  1403. XArgument <char> is a integer value of which the lower eight
  1404. Xbits are used or a string value of which the first character is used.
  1405. X
  1406. XIf a write error occurs, procedure execution is terminated.
  1407. X.DS L
  1408. XExample:
  1409. X
  1410. X    $s0='abc'; fputc 1 $s0        writes 'a'
  1411. X    $i0=0x30 ; fputc 1 $i0        writes '0'
  1412. X.DE
  1413. X
  1414. X.*s 2 "fputs"
  1415. X
  1416. Xusage: fputs [-n] <filenum> <str>
  1417. X
  1418. XThis command writes the string <str> into <filenum>.
  1419. XThe <filenum> argument is an
  1420. Xinteger file number representing a file opened with the
  1421. X.B fopen
  1422. Xcommand.
  1423. X
  1424. XIf the switch '-n' is omitted, a newline is appended after <str>
  1425. Xin the file; if present, no newline is written.
  1426. X
  1427. XIf a write error occurs, procedure execution is terminated.
  1428. X.DS L
  1429. XExample:
  1430. X
  1431. X    $s0='abc'; fputc 1 $s0        writes 'a'
  1432. X.DE
  1433. X
  1434. X.*s 2 "fseek"
  1435. X
  1436. Xusage: fseek <filenum> <position>
  1437. X
  1438. XThis command sets the file position of <filenum> to <position>,
  1439. Xan integer value.
  1440. XThe corresponding integer function
  1441. X.B %ftell
  1442. Xmay be used to determine the current file position.
  1443. X
  1444. X.B Note :
  1445. Xif <filenum> is open for append ('-a'), then the
  1446. X.B fseek
  1447. Xcommand will have no effect.
  1448. X
  1449. X.*s 2 "getf"
  1450. X
  1451. X.DS L
  1452. Xusage: getf -x <int-var-spec> <offset>
  1453. X
  1454. Xwhere: -x ==
  1455. X   -b byte
  1456. X   -w word (little-endian)
  1457. X   -W word (big-endian)
  1458. X   -l 32-bits (little-endian)
  1459. X   -L 32-bits (big-endian)
  1460. X.DE
  1461. X
  1462. X.*s 2 "gosub"
  1463. X
  1464. Xusage: gosub <label>
  1465. X
  1466. XThis command transfers control of procedure to a statement
  1467. Xother than the one immediately following.  The <label>
  1468. Xargument may be literal text or may be a string, allowing
  1469. Xa "computed gosub" feature.
  1470. X
  1471. XWhen the next return statement is executed, control is
  1472. Xreturned to the 
  1473. Xnext statement after the gosub.
  1474. X
  1475. X.DS L
  1476. XExample:
  1477. X
  1478. X    gosub GET_NEXT
  1479. X    gosub 'GET_NEXT'
  1480. X    gosub 'GET'+'_NEXT'
  1481. X    $s0 = 'GET_NEXT'; gosub $s0
  1482. X    $s0 = 'NEXT'; gosub 'GET_'+$s0
  1483. X
  1484. XNote: all the above examples cause transfer to the label GET_NEXT.
  1485. X.DE
  1486. X.DS L
  1487. XA switch or case function of sorts may be implemented by something like:
  1488. X
  1489. X    #$i0 has been set to the "switch" value
  1490. X    ifi $i0 < 0 || $i0 > 2  # avoid gosub label not found
  1491. X    {
  1492. X        echo 'bad my_case state value'+%itos($i0)
  1493. X        DO SOMETHING LIKE DIE OR DUMP VARS AND DIE
  1494. X    }
  1495. X    $s0 = 'my_case_'+%itos($i0,03)
  1496. X    gosub $s0
  1497. X
  1498. Xmy_case_000
  1499. X    echo 'handle case 0'
  1500. X    return
  1501. X
  1502. Xmy_case_001
  1503. X    echo 'handle case 1'
  1504. X    return
  1505. X
  1506. Xmy_case_002
  1507. X    ifi $i_already_did_002
  1508. X    {
  1509. X        echo 'whoops'
  1510. X        return
  1511. X    }
  1512. X    echo 'handle case 2'
  1513. X    $i_already_did_002 = 1
  1514. X    return
  1515. X.DE
  1516. X
  1517. X.*s 2 "gosubb"
  1518. X
  1519. Xusage: gosubb <label>
  1520. X
  1521. XThis command serves the same function as the
  1522. X.B gosub
  1523. Xcommand except the programmer is signifying that the label
  1524. Xis
  1525. X.B b ehind
  1526. Xthe current statement, resulting in slightly faster execution.
  1527. X(The label is not REQUIRED to be at any specific location
  1528. Xin the procedure relative to the
  1529. X.B gosubb
  1530. Xstatement.)
  1531. X
  1532. X.*s 2 "goto"
  1533. X
  1534. Xusage: goto <label>
  1535. X
  1536. XThis command transfers control of procedure to a statement
  1537. Xother than the one immediately following.  The <label>
  1538. Xargument may be literal text or may be a string, allowing
  1539. Xa "computed goto" feature.
  1540. X.DS L
  1541. XExample:
  1542. X
  1543. X    goto GET_NEXT
  1544. X    goto 'GET_NEXT'
  1545. X    goto 'GET'+'_NEXT'
  1546. X    $s0 = 'GET_NEXT'; goto $s0
  1547. X    $s0 = 'NEXT'; goto 'GET_'+$s0
  1548. X.DE
  1549. XNote: all the above examples cause transfer to the label GET_NEXT.
  1550. X
  1551. X.*s 2 "gotob"
  1552. X
  1553. Xusage: gotob <label>
  1554. X
  1555. XThis command serves the same function as the
  1556. X.B goto
  1557. Xcommand except the programmer is signifying that the label
  1558. Xis
  1559. X.B b ehind
  1560. Xthe current statement, resulting in slightly faster execution.
  1561. X(The label is not REQUIRED to be at any specific location
  1562. Xin the procedure relative to the
  1563. X.B gotob
  1564. Xstatement.)
  1565. X
  1566. X.*s 2 "hangup"
  1567. X
  1568. Xusage: hangup
  1569. X
  1570. XThis command causes Data Terminal Ready (DTR)
  1571. Xto be dropped momentarily, causing (hopefully)
  1572. Xthe termination of any current connection
  1573. Xto a remote system. 
  1574. XThis command is only effective if the attached Data Communications
  1575. XEquipment is configured
  1576. Xto terminate its connection on loss of DTR.
  1577. X
  1578. XIf no line is attached, the command is ignored (a warning
  1579. Xis generated if procedure tracing is enabled).
  1580. X
  1581. X.*s 2 "hexdump"
  1582. X
  1583. X.DS L
  1584. Xusage: hexdump [-s] <str>
  1585. X       hexdump -t[s] <str1> <str>
  1586. X
  1587. X<str> buf to dump
  1588. X<str1> title (if -t)
  1589. X-s short (terse) dump
  1590. X.DE
  1591. X
  1592. XThis command prints a hexadecimal dump of <str> on the screen
  1593. X(and to the procedure log file, if logging enabled with the
  1594. X.B ptrace
  1595. Xcommand).
  1596. X
  1597. XThe switch '-t' signifies that <str1> is a title to be printed
  1598. X.DS L
  1599. XExample:
  1600. X
  1601. X    $s0='The quick brown fox jumped over the lazy dog\e's back'
  1602. X    hexdump -t 'Example hex dump' $s0
  1603. X---------------------------- Example hex dump ----------------------------
  1604. X0000  54 68 65 20 71 75 69 63 6B 20 62 72 6F 77 6E 20 | The quick brown  |
  1605. X0010  66 6F 78 20 6A 75 6D 70 65 64 20 6F 76 65 72 20 | fox jumped over  |
  1606. X0020  74 68 65 20 6C 61 7A 79 20 64 6F 67 27 73 20 62 | the lazy dog's b |
  1607. X0030  61 63 6B                                        | ack              |
  1608. X.DE
  1609. X.DS L
  1610. X    hexdump %left($s0,9)
  1611. X0000  54 68 65 20 71 75 69 63 6B                      | The quick        |
  1612. X.DE
  1613. X.DS L
  1614. X    hexdump -ts 'Example hex dump' %left($s0,9)
  1615. XExample hex dump
  1616. X0000  54 68 65 20 71 75 69 63 6B | The quick |
  1617. X.DE
  1618. X.DS L
  1619. X    hexdump -s %left($s0,9)
  1620. X0000  54 68 65 20 71 75 69 63 6B | The quick |
  1621. X.DE
  1622. X
  1623. X.*s 2 "home"
  1624. X
  1625. Xusage: home
  1626. X
  1627. XThis command homes the video cursor.
  1628. X
  1629. X.*s 2 "icolor"
  1630. X
  1631. Xusage: icolor <int-colors>
  1632. X
  1633. XThis command sets the normal and reverse foreground
  1634. Xand background colors according to <int-colors>, an integer
  1635. Xvalue in the format as that returned by the
  1636. X.B %colors
  1637. Xinteger function.
  1638. X
  1639. XThis command is provided primarily to be able to save the color
  1640. Xstate, modify it temporarily and then restore it.
  1641. X.DS L
  1642. XExample:
  1643. X
  1644. X    mkvar $icolor_save; $icolor_save = %colors
  1645. X    color red; echo 'Connection seems to be dead'
  1646. X    icolor $icolor_save # restore previous colors
  1647. X.DE
  1648. X
  1649. X.*s 2 "ifi"
  1650. X
  1651. X.DS L
  1652. Xusage: ifi <int> <rel-op> <int> <statement>
  1653. X       ifi <int> <rel-op> <int>
  1654. X           <statement>
  1655. X       ifi <int> <rel-op> <int>
  1656. X       {
  1657. X           any kind or number of statements
  1658. X       }
  1659. X.DE
  1660. X
  1661. XThis command selectively executes one or more statements
  1662. Xbased on a test of two integer quantities.  See the
  1663. Xdescription of the
  1664. X.B break ,
  1665. X.B continue ,
  1666. Xand
  1667. X.B else
  1668. Xcommmands for examples of how the command is used.
  1669. X
  1670. X.*s 2 "ifs"
  1671. X
  1672. X.DS L
  1673. Xusage: ifs <str> <rel-op> <str> <statement>
  1674. X       ifs <int> <rel-op> <int>
  1675. X           <statement>
  1676. X       ifs <int> <rel-op> <int>
  1677. X       {
  1678. X           any kind or number of statements
  1679. X       }
  1680. X.DE
  1681. X
  1682. XThis command selectively executes one or more statements
  1683. Xbased on a test of two string values.  See the
  1684. Xdescription of the
  1685. X.B break ,
  1686. X.B continue ,
  1687. Xand
  1688. X.B else
  1689. Xcommmands
  1690. Xand many other examples throughout the document,
  1691. Xfor examples of how the command is used.
  1692. X
  1693. X.*s 2 "insline"
  1694. X
  1695. Xusage: insline
  1696. X
  1697. XThis command inserts a line onto the video screen at the current line.
  1698. X
  1699. X.*s 2 "lbreak"
  1700. X
  1701. Xusage: lbreak
  1702. X
  1703. XThis command transmits a break to the remote system.
  1704. XIt is the procedure command analogous to the
  1705. X.B break
  1706. Xinteractive command.
  1707. X
  1708. X.*s 2 "lgets"
  1709. X
  1710. X.DS L
  1711. Xusage: lgets [-er] <strvar> <t1-int> <t2-int> [<stop-str>]
  1712. X
  1713. X-e echo received characters to screen
  1714. X-r raw read (retain carriage returns)
  1715. X.DE
  1716. X
  1717. XThis command reads a string from the attached communications
  1718. Xline.
  1719. X<t1-int> is the number of tenths of seconds before
  1720. Xtiming out waiting for the first character to be received.
  1721. X<t2-int> is the number of tenths of seconds before
  1722. Xtiming out on later characters.
  1723. X<stop-str> is an optional argument, which if received, immediately
  1724. Xterminates the read.
  1725. XInteger variable $i0 is set to the count of characters received.
  1726. X
  1727. XIf the specified string variable is filled with characters
  1728. Xbefore the <stop-str> has been encountered or before a timeout
  1729. Xoccurs, then the command returns with $i0 set to the maximum
  1730. Xsize of the variable.  
  1731. X
  1732. XMost procedure commands will increase the size of an 
  1733. Xunumbered string variable as needed until the maximum 
  1734. Xstring size is reached.
  1735. XThe
  1736. X.B lgets
  1737. Xcommand
  1738. X.I does
  1739. X.I not .
  1740. XYou must start with the command with a string variable whose maximum size
  1741. Xis already the desired value.
  1742. XRefer to the section on string variables
  1743. Xabove and the section describing the
  1744. X.B mkvar
  1745. Xcommand below for information on the size of string variables.
  1746. X
  1747. X.*s 2 "logevent"
  1748. X
  1749. X.DS L
  1750. Xusage: logevent <str>
  1751. X.DE
  1752. X
  1753. XThis command writes a log item to ~/.ecu/log.
  1754. X
  1755. X.DS L
  1756. XExample:
  1757. X
  1758. X    $s0='/tmp/alm.log'
  1759. X    log 'appending alarm info to '+$s0
  1760. X
  1761. Xwrites:
  1762. X10-02-1989-17:39-01261-PROC appending alarm info to /tmp/alm.log
  1763. X.DE
  1764. Xassuming the transmitter process pid is 1261 and you are living in
  1765. X1989.
  1766. X.*s 2 "lookfor"
  1767. X
  1768. X.DS L
  1769. Xlookfor [-e] [quiet | <str>] [<timeout-int>]
  1770. X
  1771. X-e echo to screen while "looking"
  1772. X.DE
  1773. XThis command is used to read from the attached commuications line
  1774. Xuntil one of two user-specified conditions occurs.
  1775. X
  1776. XThe 'quiet' option waits for the line to become
  1777. Xquiet for the number of tenths of seconds specified  by <timeout-int>.
  1778. X
  1779. XThe other option reads the line until <str> is read from the line
  1780. Xor until <timeout-int> tenths of seconds elapses.  With this option,
  1781. Xinteger variable $i0 is set to 1 if <str> is found within the
  1782. Xtimeout period or 0 if not.
  1783. X
  1784. X.DS L
  1785. XExamples:
  1786. X
  1787. X    lookfor -e quiet 20   wait for quiet line for 2 secs
  1788. X    lookfor 'word:' 50    wait for 'word:' for up to 5 secs
  1789. X.DE
  1790. X.*s 2 "mkvar"
  1791. X
  1792. X.DS L
  1793. Xusage: mkvar [$]i<name>
  1794. X       mkvar [$]s<name>(<size>)
  1795. X.DE
  1796. X
  1797. XThis command creates one or more named (temporary)
  1798. Xinteger or string variables.
  1799. XThe variable type is determines by the first character
  1800. Xof the variable, which must be 'i' or 's'.  The size of a string
  1801. Xvariable must be specified via the <size> argument.  An optional '$'
  1802. Xmay be supplies for neatness, but may be omitted if desired.
  1803. X
  1804. X.*s 3 "Variable Names"
  1805. X
  1806. XThe names for created (named, temporary) variables consist of
  1807. Xa dollar sign ('$'), an 'i' for integer or 's' for string and
  1808. Xup to fifteen characters from the set [A-Za-z0-9_].
  1809. X
  1810. XThe first character after the 'i' or 's' in <name> 
  1811. Xmust be non-numeric.  '$sxyz' and '$s_3xyz' are legal, but '$s3xyz'
  1812. Xis not (it would be interpreted as '$s3' followed by the illegal
  1813. Xcommand sequence 'xyz').
  1814. X
  1815. XThe <name> space for integer and string variables are separate.
  1816. XIt is possible to have an integer variable named '$ixyz' and a string
  1817. Xvariable named '$sxyz'.  
  1818. X
  1819. X.*s 3 "Variable Life and Scope"
  1820. X
  1821. XThe life and scope of created variables is for
  1822. Xthe duration of the execution
  1823. Xof the creating procedure.  Procedures called
  1824. Xby the creating procedure (by 'do') can reference
  1825. Xtemporary variables declared by a
  1826. Xprevious procedure.  When created, integer variables are set
  1827. Xto zero and string variables are set to zero length.
  1828. XThese features differ from numbered variables
  1829. Xwhich retain their scope and values at all times, even when
  1830. Xprocedure execution terminates and ECU returns to interactive mode.
  1831. X
  1832. XVariables may be created by the same name more than once.
  1833. XThe latest mkvar execution specifies the variable referenced.
  1834. XThus if proc1 declares '$ixx' and calls proc2 which also declares '$ixx',
  1835. Xproc2's variable is distinct from proc1's and disappears when proc2
  1836. Xterminates, thus making proc1's available to it again, containing
  1837. Xthe same value as it had at the time proc2 was called.
  1838. X
  1839. X.*s 3 "String Variable Size"
  1840. X
  1841. XThe maximum value for <size> is 16384.
  1842. XRegardless of the size specified in the creation of a string
  1843. Xvariable, ECU will usually expand it's size as necessary up to the
  1844. Xmaximum.  Check the documentation for the operation you are
  1845. Xperforming; if there is no exception noted, ECU will expand
  1846. Xthe string maximum size as necessary.  For instance, the
  1847. Xset command will grow a string as part of assignment.  However,
  1848. Xthe
  1849. X.B lgets
  1850. Xcommand will not.
  1851. X
  1852. X.DS L
  1853. XExamples:
  1854. X
  1855. X    mkvar i_count
  1856. X    mkvar $i_count
  1857. X    mkvar s_20(20),s_80(80),i_timeout,$i_colors
  1858. X.DE
  1859. X
  1860. X.*s 2 "nap"
  1861. X
  1862. Xusage: nap <int>
  1863. X       nap -m <int>
  1864. X
  1865. XThis command suspends procedure execution for <int> tenths of
  1866. Xseconds if 
  1867. X.B -m
  1868. Xis not specified.
  1869. XIf -m is used, execution is suspended for <int> milliseconds.
  1870. XNote: the actual period execution is suspended depends, as usual,
  1871. Xon the scheduling load of the system.  For small -m values, be aware
  1872. Xthat the granularity of the nap duration is set by the system,
  1873. X20 milliseconds for XENIX 286 and 386, 10 milliseconds for UNIX.
  1874. X
  1875. XIf you need to know the frequency of the system clock,
  1876. Xsomething like
  1877. X.DS L
  1878. X      $i0 = %stoi(%getenv("HZ"))
  1879. X.DE
  1880. Xwill obtain the value for you (provided HZ is in the process' environment).
  1881. X.DS L
  1882. XExamples:
  1883. X
  1884. X    nap 30
  1885. X    nap $i0*$i2
  1886. X    nap -m 50
  1887. X.DE
  1888. X
  1889. X.*s 2 "nice"
  1890. X
  1891. Xusage: nice <int>
  1892. X
  1893. XThis command sets the nice value of the process.  It behaves
  1894. Xexactly like the nice(S) or nice(2) system call. The <int> argument
  1895. Xmust be in the range 0 through 39, inclusive.  If the call
  1896. Xfails, a warning is printed and the procedure continues to
  1897. Xexecute.  The current nice value may be obtained using the
  1898. X.B %nice
  1899. Xinteger function.  See also the description of the
  1900. X.B nice
  1901. Xinteractive command. 
  1902. X
  1903. X.*s 2 "parity"
  1904. X
  1905. X.DS L
  1906. Xusage: parity [even | odd | none]
  1907. X       parity <str>
  1908. X.DE
  1909. X
  1910. XThis command sets the parity for the attached communications line.
  1911. XIf <str> is supplied, the first character must be 'e', 'o' or 'n'.
  1912. XUppercase equivalents are also accepted.
  1913. X
  1914. X.DS L
  1915. XExamples:
  1916. X
  1917. X    parity even
  1918. X    parity 'e'
  1919. X    parity 'Even now as we speak'
  1920. X.DE
  1921. X
  1922. X.*s 2 "pclose"
  1923. X
  1924. Xusage: pclose <filenum>
  1925. X
  1926. XThis command should be issued when a command started by the
  1927. Xinteractive
  1928. X.B popen
  1929. Xcommandf completes.
  1930. X
  1931. X.*s 2 "plog"
  1932. X
  1933. X.DS L
  1934. Xusage: plog
  1935. X       plog <str>
  1936. X       plog off
  1937. X.DE
  1938. X
  1939. XThis command controls logging to a file of the screen output during
  1940. Xprocedure execution.  With no argument, the command displays the status
  1941. Xof logging.  <str> specifies a log file pathname, while the 'off'
  1942. Xargument turns logging off.
  1943. X
  1944. XIf procedure execution terminates due to an error, procedure logging
  1945. Xis turned off.  However, if procedure execution terminates
  1946. Xnormally while logging is active, erratic and unpredictable portions
  1947. Xof interactive mode screen output will continue to be logged to
  1948. Xthe current log file.
  1949. X
  1950. XThe interactive mode command
  1951. X.B plog
  1952. Xmay also be used to control procedure logging.
  1953. SHAR_EOF
  1954. true || echo 'restore of doc/_p_cmd.txt failed'
  1955. fi
  1956. echo 'End of ecu320 part 37'
  1957. echo 'File doc/_p_cmd.txt is continued in part 38'
  1958. echo 38 > _shar_seq_.tmp
  1959. exit 0
  1960.  
  1961. exit 0 # Just in case...
  1962.