home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume21 / ecuman / part03 < prev    next >
Text File  |  1991-08-09  |  55KB  |  2,379 lines

  1. Newsgroups: comp.sources.misc
  2. From: Warren Tucker <wht@n4hgf.Mt-Park.GA.US>
  3. Subject:  REPOST: v21i092:  Manual for ECU comm package rev 3.10, Part03/04
  4. Message-ID: <1991Aug9.181257.28612@sparky.IMD.Sterling.COM>
  5. X-Md4-Signature: 1118feaeee9a9ba19a99f9996df95d44
  6. Date: Fri, 9 Aug 1991 18:12:57 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: Warren Tucker <wht@n4hgf.Mt-Park.GA.US>
  10. Posting-number: Volume 21, Issue 92
  11. Archive-name: ecuman/part03
  12. Environment: SCO, XENIX, ISC
  13. Supersedes: ecuman3: Volume 16, Issue 22-24
  14.  
  15. [ Trouble with this getting out so lets try again... -Kent+ ]
  16.  
  17. ---- Cut Here and feed the following to sh ----
  18. #!/bin/sh
  19. # this is ecuman310.03 (part 3 of ecuman310)
  20. # do not concatenate these parts, unpack them in order with /bin/sh
  21. # file doc/ecu.man continued
  22. #
  23. if touch 2>&1 | fgrep 'amc' > /dev/null
  24.  then TOUCH=touch
  25.  else TOUCH=true
  26. fi
  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" != 3; 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/ecu.man'
  41. else
  42. echo 'x - continuing file doc/ecu.man'
  43. sed 's/^X//' << 'SHAR_EOF' >> 'doc/ecu.man' &&
  44. X
  45. X
  46. X
  47. X    usage: else    <statement>
  48. X
  49. X       else
  50. X           <statement>
  51. X
  52. X       else
  53. X       {
  54. X        any kind and number of statements
  55. X       }
  56. X
  57. X       else    <if> <statement>
  58. X
  59. X       else    <if>
  60. X       {
  61. X        any kind and number of statements
  62. X       }
  63. X
  64. X
  65. X    language manner.
  66. X
  67. X    For    the purposes of    describing this    command, <statement> is    any single
  68. X    or compound    statement NOT containing a whilei or whiles command.  If you
  69. X    wish to have a while-type command executed as part of an else condition,
  70. X    the    while must occur within    braces ("{}").
  71. X
  72. X    <if> is an ifi or ifs command followed by an <if-condition>    (see the
  73. X    description    of the ifi or ifs commands below).
  74. X
  75. X
  76. X
  77. X
  78. X
  79. X
  80. X
  81. X
  82. X
  83. X
  84. X
  85. X
  86. X
  87. X
  88. X
  89. X
  90. X
  91. X
  92. X
  93. X
  94. X
  95. X
  96. X
  97. X
  98. X
  99. X
  100. X
  101. X    Public Domain by wht@n4hgf                 7/25/91
  102. X
  103. X
  104. X
  105. X
  106. X
  107. X
  108. X
  109. X    ECU    Technical Description                      59
  110. X
  111. X
  112. X
  113. X    Example:
  114. X
  115. X    #+------------------------------------------------------
  116. X    # finger.ep    - procedure to send 'finger' to    remote
  117. X    # BSD Unix system; print resulting lines in    different
  118. X    # colors: uucp logins green, root red, others cyan
  119. X    #-------------------------------------------------------
  120. X
  121. X    mkvar $icolor; $icolor = %colors
  122. X    mkvar $itimeout
  123. X    $itimeout = 50       # timeout for first line 5 secs
  124. X    send 'ps -aux'       # send command, but do not echo
  125. X    lookfor    '0 40     # swallow command
  126. X    whilei 1==1       # forever, or until break
  127. X    {
  128. X        lgets 0 $itimeout 1    '0 #get    a line
  129. X        ifi    $i0 = 0    break #if no chaacters read
  130. X        $itimeout =    10 #wait 1 sec for later lines
  131. X
  132. X        ifi    %instr($s0,'% ') >= 0 #    if csh prompt seen
  133. X        break              #    exit while loop
  134. X        else ifi %instr($s0,'Login') >= 0
  135. X        color gray
  136. X        else ifi %instr($s0,'root')    >= 0
  137. X        color red
  138. X        else ifi %instr($s0,'uucp')    >= 0
  139. X        color green
  140. X        else color cyan
  141. X        echo $s0
  142. X    }
  143. X    icolor $icolor #restore    entry colors
  144. X    send ''           #force a    new prompt from    remote
  145. X
  146. X
  147. X
  148. X
  149. X    5.4.16  exit
  150. X
  151. X    usage: exit    [<status>]
  152. X
  153. X    This command causes    an abrupt termination of the ECU program.  Any
  154. X    existing connection    with a remote system is    terminated immediately.     If
  155. X    no integer argument    <status> is found, ECU exits with a program exit
  156. X    status of 0.  If <status> is found and the value is    zero, then ECU exits
  157. X    with a program exit    status of 0.  If <status> non-zero,its value must be
  158. X    in the range of 1 to 31, and ECU exits with    a program exit status of 192
  159. X    plus <status>.  This feature allows    batch executions of ECU    by shell
  160. X    script detect user-determined ECU execution    status.     See the section
  161. X    titled "Exit Codes".
  162. X
  163. X
  164. X
  165. X
  166. X
  167. X    Public Domain by wht@n4hgf                 7/25/91
  168. X
  169. X
  170. X
  171. X
  172. X
  173. X
  174. X
  175. X    ECU    Technical Description                      60
  176. X
  177. X
  178. X
  179. X    5.4.17  expresp
  180. X
  181. X    usage: expresp [-v[v...]] <exp-resp-str> [<timeout_msecs>]
  182. X
  183. X    This command emulates the uuchat function as described in the SCO HDB
  184. X    UUCP documentation and in the /usr/lib/uucp/Dialers    file.
  185. X
  186. X    -v causes the expect-respond conversation between ECU and the remote
  187. X    system to be displayed on the screen.  This    switch is automatically
  188. X    enabled if procdedure tracing is enabled.
  189. X
  190. X    multiple v's (e.g.,    -vv, -vvv) up to 3 'v's    produce    more verbose debug
  191. X    output. -vv    causes each base level expect and respond string to be
  192. X    displayed. -vvv causes a hexadecimal dump of each  interpreted expect
  193. X    string to be displayed.
  194. X
  195. X    <exp-resp-str> is as defined in /usr/lib/ecu/Dialers.
  196. X
  197. X       Meaning of some of the escape characters:
  198. X    - pause    (approximately 1/4-1/2 second delay)
  199. X
  200. X    - delay    (2 seconds)
  201. X       D - phone number/token
  202. X       T - phone number    with Dialcodes and character translation
  203. X       N - null    byte
  204. X       K - insert a BREAK
  205. X       E - turn    on echo    checking (for slow devices)
  206. X       \--carriagefreturnchecking
  207. X       - send new-line
  208. X    n - send octal number
  209. X       m## - delay ## milliseconds (NOT    SUPPORTED BY DIALERS;
  210. X        SEE BELOW)
  211. X       ~t[##] -    set timeout to ## seconds (see below)
  212. X       ~m[##] -    set timeout to ## milliseconds (see below)
  213. X       Speed - Hayes-specific speed-adaptive connect handler
  214. X
  215. X
  216. X    <timeout_msecs> specifies an optional timeout in milliseconds for
  217. X    waiting on expect strings;    it defaults to 10,000 milliseconds (10
  218. X    seconds).  The resolution for timeouts is limited to the basic tick    time
  219. X    of your system (HZ,    10 msec    for UNIX/386 3.2.0, 16 (1000/60) msec for
  220. X    3.2.1 and later or any ODT 20 msec for XENIX/386 and XENIX/286).  The
  221. X    timeout for    'Speed'    expects    is fixed at 90 seconds.
  222. X
  223. X    \m### causes a ### millisecond delay.  Note    this adds an ambiguity to
  224. X    the    syntax of the send string: you may not follow an m delay with a
  225. X    literal digit to send.  For    example, suppose you wish to delay 300
  226. X    missileconds then send "4A".  \m3004A will delay for 3004
  227. X    (approximately) milliseconds, then send an "A".
  228. X
  229. X    Integer variable $i0 is set    to one if the expect-respond script fails,
  230. X
  231. X
  232. X
  233. X    Public Domain by wht@n4hgf                 7/25/91
  234. X
  235. X
  236. X
  237. X
  238. X
  239. X
  240. X
  241. X    ECU    Technical Description                      61
  242. X
  243. X
  244. X
  245. X    else it is set to 0.
  246. X
  247. X
  248. X
  249. X    5.4.18  fchmod
  250. X
  251. X    usage: fchmod <mode> <file>
  252. X
  253. X    This command sets the mode of <file> to <mode>.  The <mode>    argument
  254. X    takes one of two forms, a nine-character mode string (e.g.,    'rwxr-xr-x')
  255. X    or an integer value    (0755).     The <file> argument is    either a string
  256. X    value forming a filename or    an integer file    number representing a file
  257. X    opened with    the fopen command.
  258. X
  259. X    The    command    sets $i0 = 0 if    successful, else to the    errno from the
  260. X    associated system call (refer to the %errstr string    function and/or
  261. X    /usr/include/sys/errno.h).
  262. X
  263. X
  264. X    Example:
  265. X
  266. X    fopen 1    '/tmp/123'; fchmod 'rwxrwxrwx' 1
  267. X    fchmod 'rwxrwxrwx' '/tmp/123'
  268. X    fopen 1    '/tmp/123'; fchmod 0777    1
  269. X    $i0 = 0777; fchmod $i0 '/tmp/123'
  270. X
  271. X    All    of the above example result in the same    result.
  272. X
  273. X
  274. X
  275. X    5.4.19  fclose
  276. X
  277. X    usage: fclose <file>
  278. X
  279. X    This command closes    <file>.     The <file> argument is    an integer file
  280. X    number representing    a file opened with the fopen command.
  281. X
  282. X    The    command    is ignored if <file> is    not open.  No integer variable is
  283. X    modified by    fclose.
  284. X
  285. X
  286. X    Example:
  287. X
  288. X    fclose 1
  289. X
  290. X
  291. X
  292. X    5.4.20  fdel
  293. X
  294. X    usage: fdel    <file>
  295. X
  296. X
  297. X
  298. X
  299. X    Public Domain by wht@n4hgf                 7/25/91
  300. X
  301. X
  302. X
  303. X
  304. X
  305. X
  306. X
  307. X    ECU    Technical Description                      62
  308. X
  309. X
  310. X
  311. X    This command removes a file.
  312. X
  313. X    The    command    sets $i0 = 0 if    successful, else to the    errno from the
  314. X    associated system call (refer to the %errstr string    function and/or
  315. X    /usr/include/sys/errno.h).
  316. X
  317. X
  318. X    Example:
  319. X
  320. X    fdel '/tmp/123'
  321. X
  322. X
  323. X
  324. X    5.4.21  fgetc
  325. X
  326. X    usage: fgetc <file>    <destination>
  327. X
  328. X    This command reads a character from    <file>.     The <file> argument is    an
  329. X    integer file number    representing a file opened with    the fopen command.
  330. X
  331. X    The    argument <destination> is either a string variable or an integer
  332. X    variable.  If the file has reached end of file: an integer variable
  333. X    receives -1; a string variable is returned null.  Otherwise, the
  334. X    character's    numeric    value (0-255) is placed    in an integer variable or a
  335. X    string variable is returned    with a length of one with the file character
  336. X    as its only    character.
  337. X
  338. X
  339. X    Example:
  340. X
  341. X    fgetc 1    $s0
  342. X    fgetc 1    $i_input
  343. X
  344. X
  345. X
  346. X    5.4.22  fgets
  347. X
  348. X    usage: fgets <file>    <strvar>
  349. X
  350. X    This command reads a character from    <file>.     The <file> argument is    an
  351. X    integer file number    representing a file opened with    the fopen command.
  352. X
  353. X    The    argument <strvar> is a string variable.     If the    file has reached end
  354. X    of file, <strvar> is returned null and integer variable $i0    is set to 1.
  355. X    Otherwise, the <strvar> receives input from    the file minus the trailing
  356. X    newline and    $i0 is returned    zero.
  357. X
  358. X
  359. X
  360. X
  361. X
  362. X
  363. X
  364. X
  365. X    Public Domain by wht@n4hgf                 7/25/91
  366. X
  367. X
  368. X
  369. X
  370. X
  371. X
  372. X
  373. X    ECU    Technical Description                      63
  374. X
  375. X
  376. X
  377. X    Example:
  378. X
  379. X    fgets 1    $s0
  380. X
  381. X
  382. X
  383. X    5.4.23  fkey
  384. X
  385. X    usage: fkey    <str>
  386. X
  387. X    This command selects a function key    definition from    the ~/.ecu/keys
  388. X    file.
  389. X
  390. X
  391. X    5.4.24  flush
  392. X
  393. X    usage: flush
  394. X
  395. X    This command causes    any characters received    by the system from the line,
  396. X    but    not yet    read by    the procedure to be "forgotten"    or flushed.
  397. X
  398. X
  399. X    5.4.25  fopen
  400. X    usage: fopen [-switches] <filenum> <filename>
  401. X
  402. X    This command opens a file named by the string argument <filename> and
  403. X    associates it with the user-chosen file number <filenum> (which must be
  404. X    an integer value between 0 and 4, inclusive).
  405. X
  406. X    The    argument switches govern how a file is opened and must be chosen
  407. X    from this list:
  408. X
  409. X    -r       The file is opened read-only; if it does not    exist, an
  410. X           error occurs.
  411. X
  412. X    -r+       The file is opened for reading and writing; if it does
  413. X           not exist, an error occurs.
  414. X
  415. X    -w       The file is opened for writing (any previous    contents of
  416. X           the file are    lost); if it does not exist, it    is created.
  417. X
  418. X    -w+       The file is opened for reading and writing (any previous
  419. X           contents of the file    are lost); if it does not exist, it
  420. X           is created.
  421. X
  422. X    -a       The file is opened for appending (writes to the file    are
  423. X           added to the    previous file contents); if it does not
  424. X           exist, it is    created.  All writes are appended to the
  425. X           file    (the fseek command has no effect).
  426. X
  427. X    The    switches parameter may be omitted; in such cases, the file is opened
  428. X
  429. X
  430. X
  431. X    Public Domain by wht@n4hgf                 7/25/91
  432. X
  433. X
  434. X
  435. X
  436. X
  437. X
  438. X
  439. X    ECU    Technical Description                      64
  440. X
  441. X
  442. X
  443. X    as though '-r' had been supplied.  However,    if procedure tracing is
  444. X    enabled (see the description of the    interactive and    procedure command
  445. X    ptrace), a warning message will be issued.
  446. X
  447. X    The    command    sets $i0 = 0 if    successful, else to the    errno from the
  448. X    associated system call (refer to the %errstr string    function and/or
  449. X    /usr/include/sys/errno.h).
  450. X
  451. X    Example:
  452. X
  453. X    fopen 0    -r '/etc/passwd'
  454. X    fopen 1    -w+ '/tmp/123'
  455. X    fopen 2    -a 'tranact.log'
  456. X
  457. X
  458. X
  459. X    5.4.26  fputc
  460. X
  461. X    usage: fputc <file>    <char>
  462. X
  463. X    This command writes    character <char> into <file>.  The <file> argument
  464. X    is an integer file number representing a file opened with the fopen
  465. X    command.  Argument <char> is a integer value of which the lower eight
  466. X    bits are used or a string value of which the first character is used.
  467. X
  468. X    If a write error occurs, procedure execution is terminated.
  469. X
  470. X    Example:
  471. X
  472. X    $s0='abc'; fputc 1 $s0          writes 'a'
  473. X    $i0=0x30 ; fputc 1 $i0          writes '0'
  474. X
  475. X
  476. X
  477. X    5.4.27  fputs
  478. X
  479. X    usage: fputs [-n] <file> <str>
  480. X
  481. X    This command writes    the string <str> into <file>.  The <file> argument
  482. X    is an integer file number representing a file opened with the fopen
  483. X    command.
  484. X
  485. X    If the switch '-n' is omitted, a newline is    appended after <str> in    the
  486. X    file; if present, no newline is written.
  487. X
  488. X    If a write error occurs, procedure execution is terminated.
  489. X
  490. X    Example:
  491. X
  492. X    $s0='abc'; fputc 1 $s0          writes 'a'
  493. X
  494. X
  495. X
  496. X
  497. X    Public Domain by wht@n4hgf                 7/25/91
  498. X
  499. X
  500. X
  501. X
  502. X
  503. X
  504. X
  505. X    ECU    Technical Description                      65
  506. X
  507. X
  508. X
  509. X    5.4.28  fseek
  510. X
  511. X    usage: fseek <file>    <position>
  512. X
  513. X    This command sets the file position    of <file> to <position.     The
  514. X    corresponding integer function %ftell may be used to determine the
  515. X    current file position.
  516. X
  517. X    Note: if <file> is open for    append ('-a'), then the    fseek command will
  518. X    have no effect.
  519. X
  520. X
  521. X    5.4.29  getf
  522. X
  523. X
  524. X    usage: getf    -x <int-var-spec> <offset>
  525. X
  526. X    where: -x ==
  527. X       -b byte
  528. X       -w word (little-endian)
  529. X       -W word (big-endian)
  530. X       -l 32-bits (little-endian)
  531. X       -L 32-bits (big-endian)
  532. X
  533. X
  534. X
  535. X    5.4.30  gosub
  536. X
  537. X    usage: gosub <label>
  538. X
  539. X    This command transfers control of procedure    to a statement other than
  540. X    the    one immediately    following.  The    <label>    argument may be    literal    text
  541. X    or may be a    string,    allowing a "computed gosub" feature.
  542. X
  543. X    When the next return statement is executed,    control    is returned to the
  544. X    next statement after the gosub.
  545. X
  546. X
  547. X    Example:
  548. X
  549. X    gosub GET_NEXT
  550. X    gosub 'GET_NEXT'
  551. X    gosub 'GET'+'_NEXT'
  552. X    $s0 = 'GET_NEXT'; gosub    $s0
  553. X    $s0 = 'NEXT'; gosub 'GET_'+$s0
  554. X
  555. X    Note: all the above    examples cause transfer    to the label GET_NEXT.
  556. X
  557. X
  558. X
  559. X
  560. X
  561. X
  562. X
  563. X    Public Domain by wht@n4hgf                 7/25/91
  564. X
  565. X
  566. X
  567. X
  568. X
  569. X
  570. X
  571. X    ECU    Technical Description                      66
  572. X
  573. X
  574. X
  575. X    A switch or    case function of sorts may be implimented by something like:
  576. X
  577. X    #$i0 has been set to the "switch" value
  578. X    ifi $i0    < 0 || $i0 > 2    # avoid    gosub label not    found
  579. X    {
  580. X        echo 'bad my_case state value'+%itos($i0)
  581. X        DO SOMETHING LIKE DIE OR DUMP VARS AND DIE
  582. X    }
  583. X    $s0 = 'my_case_'+%itos($i0,03)
  584. X    gosub $s0
  585. X
  586. X    my_case_000
  587. X    echo 'handle case 0'
  588. X    return
  589. X
  590. X    my_case_001
  591. X    echo 'handle case 1'
  592. X    return
  593. X
  594. X    my_case_002
  595. X    ifi $i_already_did_002
  596. X    {
  597. X        echo 'whoops'
  598. X        return
  599. X    }
  600. X    echo 'handle case 2'
  601. X    $i_already_did_002 = 1
  602. X    return
  603. X
  604. X
  605. X
  606. X    5.4.31  gosubb
  607. X
  608. X    usage: gosubb <label>
  609. X
  610. X    This command serves    the same function as the gosub command except the
  611. X    programmer is signifying that the label is behind the current statement,
  612. X    resulting in slightly faster execution.  (The label    is not REQUIRED    to
  613. X    be at any specific location    in the procedure relative to the gosubb
  614. X    statement.)
  615. X
  616. X
  617. X    5.4.32  goto
  618. X
  619. X    usage: goto    <label>
  620. X
  621. X    This command transfers control of procedure    to a statement other than
  622. X    the    one immediately    following.  The    <label>    argument may be    literal    text
  623. X    or may be a    string,    allowing a "computed goto" feature.
  624. X
  625. X
  626. X
  627. X
  628. X
  629. X    Public Domain by wht@n4hgf                 7/25/91
  630. X
  631. X
  632. X
  633. X
  634. X
  635. X
  636. X
  637. X    ECU    Technical Description                      67
  638. X
  639. X
  640. X
  641. X    Example:
  642. X
  643. X    goto GET_NEXT
  644. X    goto 'GET_NEXT'
  645. X    goto 'GET'+'_NEXT'
  646. X    $s0 = 'GET_NEXT'; goto $s0
  647. X    $s0 = 'NEXT'; goto 'GET_'+$s0
  648. X
  649. X    Note: all the above    examples cause transfer    to the label GET_NEXT.
  650. X
  651. X
  652. X    5.4.33  gotob
  653. X
  654. X    usage: gotob <label>
  655. X
  656. X    This command serves    the same function as the goto command except the
  657. X    programmer is signifying that the label is behind the current statement,
  658. X    resulting in slightly faster execution.  (The label    is not REQUIRED    to
  659. X    be at any specific location    in the procedure relative to the gotob
  660. X    statement.)
  661. X
  662. X
  663. X    5.4.34  hangup
  664. X
  665. X    usage: hangup
  666. X
  667. X    This command causes    Data Terminal Ready (DTR) to be    dropped    momentarily,
  668. X    causing (hopefully)    the termination    of any current connection to a
  669. X    remote system. This    command    is only    effective if the attached Data
  670. X    Communications Equipment is    configured to terminate    its connection on
  671. X    loss of DTR.
  672. X
  673. X    If no line is attached, the    command    is ignored (a warning is generated
  674. X    if procedure tracing is enabled).
  675. X
  676. X
  677. X    5.4.35  hexdump
  678. X
  679. X    usage: hexdump [-s]    <str>
  680. X       hexdump -t[s] <str1>    <str>
  681. X
  682. X
  683. X    <str> buf to dump <str1> title (if -t) -s short (terse) dump
  684. X
  685. X    This command prints    a hexadecimal dump of <str> on the screen (and to
  686. X    the    procedure log file, if logging enabled with the    ptrace command).
  687. X
  688. X    The    switch '-t' signifies that <str1> is a title to    be printed
  689. X
  690. X
  691. X
  692. X
  693. X
  694. X
  695. X    Public Domain by wht@n4hgf                 7/25/91
  696. X
  697. X
  698. X
  699. X
  700. X
  701. X
  702. X
  703. X    ECU    Technical Description                      68
  704. X
  705. X
  706. X
  707. X    Example:
  708. X
  709. X    $s0='The quick brown fox jumped    over the lazy dog's back'
  710. X    hexdump    -t 'Example hex    dump' $s0
  711. X    ---------------------------- Example hex dump ----------------------------
  712. X    0000  54 68    65 20 71 75 69 63 6B 20    62 72 6F 77 6E 20 | The    quick brown  |
  713. X    0010  66 6F    78 20 6A 75 6D 70 65 64    20 6F 76 65 72 20 | fox    jumped over  |
  714. X    0020  74 68    65 20 6C 61 7A 79 20 64    6F 67 27 73 20 62 | the    lazy dog's b |
  715. X    0030  61 63    6B                      | ack             |
  716. X
  717. X    hexdump    %left($s0,9)
  718. X    0000  54 68    65 20 71 75 69 63 6B              | The    quick         |
  719. X
  720. X    hexdump    -ts 'Example hex dump' %left($s0,9)
  721. X    Example hex    dump
  722. X    0000  54 68    65 20 71 75 69 63 6B | The quick |
  723. X
  724. X    hexdump    -s %left($s0,9)
  725. X    0000  54 68    65 20 71 75 69 63 6B | The quick |
  726. X
  727. X
  728. X
  729. X    5.4.36  home
  730. X
  731. X    usage: home
  732. X
  733. X    This command homes the video cursor.
  734. X
  735. X
  736. X    5.4.37  icolor
  737. X
  738. X    usage: icolor <int-colors>
  739. X
  740. X    This command sets the normal and reverse foreground    and background
  741. X    colors according to    <int-colors>, an integer value in the format as    that
  742. X    returned by    the %colors integer function.
  743. X
  744. X    This command is provided primarily to be able to save the color state,
  745. X    modify it temporarily and then restore it.
  746. X
  747. X    Example:
  748. X
  749. X    mkvar $icolor_save; $icolor_save = %colors
  750. X    color red; echo    'Connection seems to be    dead'
  751. X    icolor $icolor_save # restore previous colors
  752. X
  753. X
  754. X
  755. X    5.4.38  ifi
  756. X
  757. X
  758. X
  759. X
  760. X
  761. X    Public Domain by wht@n4hgf                 7/25/91
  762. X
  763. X
  764. X
  765. X
  766. X
  767. X
  768. X
  769. X    ECU    Technical Description                      69
  770. X
  771. X
  772. X
  773. X    usage: ifi <int> <rel-op> <int> <statement>
  774. X       ifi <int> <rel-op> <int>
  775. X           <statement>
  776. X       ifi <int> <rel-op> <int>
  777. X       {
  778. X           any kind    or number of statements
  779. X       }
  780. X
  781. X
  782. X    This command selectively executes one or more statements based on a    test
  783. X    of two integer quantities.    See the    description of the break, continue,
  784. X    and    else commmands for examples of how the command is used.
  785. X
  786. X
  787. X    5.4.39  ifs
  788. X
  789. X    usage: ifs <str> <rel-op> <str> <statement>
  790. X       ifs <int> <rel-op> <int>
  791. X           <statement>
  792. X       ifs <int> <rel-op> <int>
  793. X       {
  794. X           any kind    or number of statements
  795. X       }
  796. X
  797. X
  798. X    This command selectively executes one or more statements based on a    test
  799. X    of two string values.  See the description of the break, continue, and
  800. X    else commmands and many other examples throughout the document, for
  801. X    examples of    how the    command    is used.
  802. X
  803. X
  804. X    5.4.40  lbreak
  805. X
  806. X    usage: lbreak
  807. X
  808. X    This command transmits a break to the remote system.
  809. X
  810. X
  811. X    5.4.41  lgets
  812. X
  813. X
  814. X    usage: lgets [-er] <strvar>    <t1-int> <t2-int> [<stop-str>]
  815. X
  816. X    -e echo received characters    to screen
  817. X    -r raw read    (retain    carriage returns)
  818. X
  819. X
  820. X    This command reads a string    from the attached communications line.
  821. X    <t1-int> is    the number of tenths of    seconds    before timing out waiting
  822. X    for    the first character to be received.  <t2-int> is the number of
  823. X    tenths of seconds before timing out    on later characters.  <stop-str> is
  824. X
  825. X
  826. X
  827. X    Public Domain by wht@n4hgf                 7/25/91
  828. X
  829. X
  830. X
  831. X
  832. X
  833. X
  834. X
  835. X    ECU    Technical Description                      70
  836. X
  837. X
  838. X
  839. X    an optional    argument, which    if received, immediately terminates the
  840. X    read.  Integer variable $i0    is set to the count of characters received.
  841. X
  842. X    If the specified string variable is    filled with characters before the
  843. X    <stop-str> has been    encountered or before a    timeout    occurs,    then the
  844. X    command returns with $i0 set to the    maximum    size of    the variable.  Refer
  845. X    to the section on string variables above and the section describing    the
  846. X    mkvar command below    for information    on the size of string variables.
  847. X
  848. X
  849. X    5.4.42  insline
  850. X
  851. X    usage: insline
  852. X
  853. X    This command inserts a line    onto the video screen at the current line.
  854. X
  855. X
  856. X    5.4.43  logevent
  857. X
  858. X    usage: logevent <str>
  859. X
  860. X
  861. X    This command writes    a log item to ~/.ecu/log.
  862. X
  863. X
  864. X    Example:
  865. X
  866. X    $s0='/tmp/alm.log'
  867. X    log 'appending alarm info to '+$s0
  868. X
  869. X    writes:
  870. X    10-02-1989-17:39-01261-PROC    appending alarm    info to    /tmp/alm.log
  871. X
  872. X    assuming the transmitter process pid is 1261 and you are living in 1989.
  873. X
  874. X    5.4.44  lookfor
  875. X
  876. X    lookfor [-e] [quiet    | <str>] [<timeout-int>]
  877. X
  878. X    -e echo to screen while "looking"
  879. X
  880. X    This command is used to read from the attached commuications line until
  881. X    one    of two user-specified conditions occurs.
  882. X
  883. X    The    'quiet'    option waits for the line to become quiet for the number of
  884. X    tenths of seconds specified     by <timeout-int>.
  885. X
  886. X    The    other option reads the line until <str>    is read    from the line or
  887. X    until <timeout-int>    tenths of seconds elapses.  With this option,
  888. X    integer variable $i0 is set    to 1 if    <str> is found within the timeout
  889. X    period or 0    if not.
  890. X
  891. X
  892. X
  893. X    Public Domain by wht@n4hgf                 7/25/91
  894. X
  895. X
  896. X
  897. X
  898. X
  899. X
  900. X
  901. X    ECU    Technical Description                      71
  902. X
  903. X
  904. X
  905. X    Examples:
  906. X
  907. X    lookfor    -e quiet 20   wait for quiet line for 2    secs
  908. X    lookfor    'word:'    50    wait for 'word:' for up to 5 secs
  909. X
  910. X    5.4.45  mkvar
  911. X
  912. X    usage: mkvar [$]i<name>
  913. X       mkvar [$]s<name>(<size>)
  914. X
  915. X
  916. X    This command creates one or    more named (temporary) integer or string
  917. X    variables.    The variable type is determines    by the first character of
  918. X    the    variable, which    must be    'i' or 's'.  The size of a string variable
  919. X    must be specified via the <size> argument.    An optional '$'    may be
  920. X    supplies for neatness, but may be omitted if desired.
  921. X
  922. X
  923. X    5.4.45.1  Variable Names
  924. X
  925. X    The    names for created (named, temporary) variables consist of a dollar
  926. X    sign ('$'),    an 'i' for integer or 's' for string and up to fifteen
  927. X    characters from the    set [A-Za-z0-9_].
  928. X
  929. X    The    first character    after the 'i' or 's' in    <name> must be non-numeric.
  930. X    '$sxyz' and    '$s_3xyz' are legal, but '$s3xyz' is not (it would be
  931. X    interpreted    as '$s3' followed by the illegal command sequence 'xyz').
  932. X
  933. X    The    <name> space for integer and string variables are separate.  It    is
  934. X    possible to    have an    integer    variable named '$ixyz' and a string variable
  935. X    named '$sxyz'.
  936. X
  937. X
  938. X    5.4.45.2  Variable Life and    Scope
  939. X
  940. X    The    life and scope of created variables is for the duration    of the
  941. X    execution of the creating procedure.  Procedures called by the creating
  942. X    procedure (by 'do')    can reference temporary    variables declared by a
  943. X    previous procedure.     When created, integer variables are set to zero and
  944. X    string variables are set to    zero length.  These features differ from
  945. X    numbered variables which retain their scope    and values at all times,
  946. X    even when procedure    execution terminates and ECU returns to    interactive
  947. X    mode.
  948. X
  949. X    Variables may be created by    the same name more than    once.  The latest
  950. X    mkvar execution specifies the variable referenced.    Thus if    proc1
  951. X    declares '$ixx' and    calls proc2 which also declares    '$ixx',    proc2's
  952. X    variable is    distinct from proc1's and disappears when proc2    terminates,
  953. X    thus making    proc1's    available to it    again, containing the same value as
  954. X    it had at the time proc2 was called.
  955. X
  956. X
  957. X
  958. X
  959. X    Public Domain by wht@n4hgf                 7/25/91
  960. X
  961. X
  962. X
  963. X
  964. X
  965. X
  966. X
  967. X    ECU    Technical Description                      72
  968. X
  969. X
  970. X
  971. X    5.4.45.3  String Variable Size
  972. X
  973. X    The    maximum    value for <size> is 5120.  Regardless of the size specified
  974. X    in the creation of a string    variable, ECU will expand it's size as
  975. X    necessary up to the    5120 character maximum.
  976. X
  977. X
  978. X    Examples:
  979. X
  980. X    mkvar i_count
  981. X    mkvar $i_count
  982. X    mkvar s20(20),s80(80),i_timeout,$i_colors
  983. X
  984. X
  985. X
  986. X    5.4.46  nap
  987. X    usage: nap <int>
  988. X       nap -m <int>
  989. X
  990. X    This command suspends procedure execution for <int>    tenths of seconds if
  991. X    -m is not specified.  If -m    is used, execution is suspended    for <int>
  992. X    milliseconds.  Note: the actual period execution is    suspended depends,
  993. X    as usual, on the scheduling    load of    the system.  For small -m values, be
  994. X    aware that the granularity of the nap duration is set by the system, 20
  995. X    milliseconds for XENIX 286 and 386,    10 milliseconds    for UNIX.
  996. X
  997. X    If you need    to know    the frequency of the system clock, something like
  998. X
  999. X      $i0 =    %stoi(%getenv("HZ"))
  1000. X
  1001. X    will obtain    the value for you (provided HZ is in the process'
  1002. X    environment).
  1003. X
  1004. X
  1005. X
  1006. X    Examples:
  1007. X
  1008. X    nap 30
  1009. X    nap $i0*$i2
  1010. X        nap    -m 50
  1011. X
  1012. X
  1013. X
  1014. X    5.4.47  nice
  1015. X    usage: nice    <int>
  1016. X
  1017. X    This command sets the nice value of    the process.  It behaves exactly
  1018. X    like the nice(S) or    nice(2)    system call. The <int> parameter must be in
  1019. X    the    range 0    through    39, inclusive.    If the call fails, a warning is
  1020. X    printed and    the procedure continues    to execute.  The current nice value
  1021. X    may    be obtained using the %nice integer function.  See also    the
  1022. X
  1023. X
  1024. X
  1025. X    Public Domain by wht@n4hgf                 7/25/91
  1026. X
  1027. X
  1028. X
  1029. X
  1030. X
  1031. X
  1032. X
  1033. X    ECU    Technical Description                      73
  1034. X
  1035. X
  1036. X
  1037. X    description    of the nice interactive    command.
  1038. X
  1039. X
  1040. X    5.4.48  parity
  1041. X
  1042. X    usage: parity [even    | odd |    none]
  1043. X       parity <str>
  1044. X
  1045. X
  1046. X    This command sets the parity for the attached communications line.    If
  1047. X    <str> is supplied, the first character must    be 'e',    'o' or 'n'.
  1048. X    Uppercase equivalents are also accepted.
  1049. X
  1050. X
  1051. X    Examples:
  1052. X
  1053. X    parity even
  1054. X    parity 'e'
  1055. X    parity 'Even now as we speak'
  1056. X
  1057. X
  1058. X
  1059. X    5.4.49  pclose
  1060. X    usage: pclose <filenum>
  1061. X
  1062. X    This command should    be issued when a command started by the    interactive
  1063. X    popen commandf completes.
  1064. X
  1065. X
  1066. X    5.4.50  plog
  1067. X
  1068. X    usage: plog
  1069. X       plog    <str>
  1070. X       plog    off
  1071. X
  1072. X
  1073. X    This command controls logging to a file of the screen output during
  1074. X    procedure execution.  With no argument, the    command    displays the status
  1075. X    of logging.     <str> specifies a log file pathname, while the    'off'
  1076. X    argument turns logging off.
  1077. X
  1078. X    If procedure execution terminates due to an    error, procedure logging is
  1079. X    turned off.     However, if procedure execution terminates normally while
  1080. X    logging is active, erratic and unpredictable portions of interactive
  1081. X    mode screen    output will continue to    be logged to the current log file.
  1082. X
  1083. X    The    interactive mode command plog may also be used to control procedure
  1084. X    logging.
  1085. X
  1086. X
  1087. X
  1088. X
  1089. X
  1090. X
  1091. X    Public Domain by wht@n4hgf                 7/25/91
  1092. X
  1093. X
  1094. X
  1095. X
  1096. X
  1097. X
  1098. X
  1099. X    ECU    Technical Description                      74
  1100. X
  1101. X
  1102. X
  1103. X    Example:
  1104. X
  1105. X    mkvar s_logname(128)
  1106. X    $s_logname = %dir+'logname'
  1107. X    plog $s_logname
  1108. X    echo 'Test'
  1109. X    plog off;cd 'somewhere_else';plog $s_logname
  1110. X    echo 'Test'
  1111. X
  1112. X
  1113. X
  1114. X    5.4.51  popd
  1115. X
  1116. X    usage: popd    [ | <#>    | all]
  1117. X
  1118. X
  1119. X    This command returns to a previous directory after a pushd command has
  1120. X    been previously executed.
  1121. X
  1122. X    If no argument is supplied,    the directory at the immediately previous
  1123. X    level is restored.
  1124. X
  1125. X    If a numeric argument is supplied, the directory at    the specified level
  1126. X    is restored; the level numbers may be obtained by issuing a    pushd
  1127. X    command with no arguments.
  1128. X
  1129. X    If the 'all' argument is supplied, it is treated as    a numeric argument
  1130. X    of 0; that is the directory    stack is cleared and the directory at level
  1131. X    0 is restored.
  1132. X
  1133. X    The    directory stack    is shared between interactive and procedure
  1134. X    commands.  Neither beginning nor ending a procedure    affects    the
  1135. X    directory stack level.
  1136. X
  1137. X
  1138. X    Examples:
  1139. X       popd
  1140. X       popd 3
  1141. X       popd all
  1142. X
  1143. X
  1144. X
  1145. X    5.4.52  popen
  1146. X    usage: popen [-switches] <filenum> <command>
  1147. X
  1148. X    This command executes a shell command defined by the string    argument
  1149. X    <command> and associates it    with the user-chosen file number <filenum>
  1150. X    (which must    be an integer value between 0 and 4, inclusive).
  1151. X
  1152. X    The    argument switches govern whether the command is    to receive input
  1153. X    from ECU or    output to ECU and must be chosen from this list:
  1154. X
  1155. X
  1156. X
  1157. X    Public Domain by wht@n4hgf                 7/25/91
  1158. X
  1159. X
  1160. X
  1161. X
  1162. X
  1163. X
  1164. X
  1165. X    ECU    Technical Description                      75
  1166. X
  1167. X
  1168. X
  1169. X    -r       The command will output to ECU.
  1170. X
  1171. X    -w       The command will receive input from ECU.
  1172. X
  1173. X    The    switches parameter may be omitted; in such cases, the file is opened
  1174. X    as though '-r' had been supplied.  However,    if procedure tracing is
  1175. X    enabled (see the description of the    interactive and    procedure command
  1176. X    ptrace), a warning message will be issued.
  1177. X
  1178. X    The    command    sets $i0 = 0 if    successful, else to the    errno from the
  1179. X    associated system call (refer to the %errstr string    function and/or
  1180. X    /usr/include/sys/errno.h).
  1181. X
  1182. X    Example:
  1183. X
  1184. X    popen 0    -r 'ls -l *.log'
  1185. X    popen 1    -w 'cat    | sort > /tmp/sorted'
  1186. X
  1187. X
  1188. X
  1189. X
  1190. X    5.4.53  prompt
  1191. X    usage: prompt <str>
  1192. X
  1193. X    This command allows    selection of an    alternate prompt to the    interactive
  1194. X    mode HOME command trigger.    Refer to the section titled "ECUPROMPT"    for
  1195. X    more information on    the interactive    mode prompt.
  1196. X
  1197. X    Note: the interactive and procedure    hangup commands    both cause the
  1198. X    default prompt to be reestablished.
  1199. X
  1200. X
  1201. X    Example:
  1202. X
  1203. X     prompt    %rname+' >'    use remote name in prompt
  1204. X
  1205. X
  1206. X
  1207. X    5.4.54  ptrace
  1208. X
  1209. X    usage: ptrace [ <str> | off    ]
  1210. X
  1211. X
  1212. X    This command controls procedure execution tracing.    Trace output is
  1213. X    written to the screen and varys in its nature depending upon the command
  1214. X    being traced.  Specifically, any change to a string    or integer variable
  1215. X    is noted.  If tracing is enabled, the output will also be written to any
  1216. X    active procedure log file (see the plog interactive    and procedure
  1217. X    commands).
  1218. X
  1219. X
  1220. X
  1221. X
  1222. X
  1223. X    Public Domain by wht@n4hgf                 7/25/91
  1224. X
  1225. X
  1226. X
  1227. X
  1228. X
  1229. X
  1230. X
  1231. X    ECU    Technical Description                      76
  1232. X
  1233. X
  1234. X
  1235. X    5.4.55  pushd
  1236. X
  1237. X    usage: pushd [ | <dir>]
  1238. X
  1239. X
  1240. X    This command either    1) saves the current directory pathname    on a stack
  1241. X    and    establishes a new current directory or 2) displays the current stack
  1242. X    and    current    directory.  The    stack size is 10.
  1243. X
  1244. X    If no argument is supplied,    the directory stack is displayed.
  1245. X
  1246. X    The    directory stack    is shared between interactive and procedure
  1247. X    commands.  Neither beginning nor ending a procedure    affects    the
  1248. X    directory stack level.
  1249. X
  1250. X
  1251. X    Examples:
  1252. X       pushd
  1253. X       pushd '/tmp'
  1254. X
  1255. X
  1256. X
  1257. X    5.4.56  putf
  1258. X
  1259. X    Not    yet implemented.
  1260. X
  1261. X
  1262. X    5.4.57  return
  1263. X    usage: return [<int>]
  1264. X
  1265. X    This command serves    two functions: to return from a    gosub to or return
  1266. X    from a procedure execution.     If <int> is supplied, it must be in the
  1267. X    range 0 to 255.  Other values result in a return value of 255.
  1268. X
  1269. X    If no gosub    is active, return causes the currently executing procedure
  1270. X    to terminate, returning either to a    calling    procedure or to    the
  1271. X    interactive    mode.  If <int>    is supplied and    it's value is nonzero, then
  1272. X    all    procedure execution is terminated and the integer status is printed
  1273. X    on the screen along    with the name of the executing procedure.
  1274. X
  1275. X    If a gosub is active, return or return 0 causes control to return to the
  1276. X    statement immediately following the    gosub which invoked the    subroutine.
  1277. X    If <int> is    supplied and it's value    is nonzero, then all procedure
  1278. X    execution is terminated and    the integer status is printed on the screen
  1279. X    along with the name    of the executing procedure.
  1280. X
  1281. X    It is not possible to terminate a procedure    with normal status from
  1282. X    within a subroutine.
  1283. X
  1284. X
  1285. X
  1286. X
  1287. X
  1288. X
  1289. X    Public Domain by wht@n4hgf                 7/25/91
  1290. X
  1291. X
  1292. X
  1293. X
  1294. X
  1295. X
  1296. X
  1297. X    ECU    Technical Description                      77
  1298. X
  1299. X
  1300. X
  1301. X    Example:
  1302. X
  1303. X    #---------------------
  1304. X    # gosub.ep
  1305. X    #---------------------
  1306. X    echo 'main'; gosub SUB;    echo 'back to main'
  1307. X    return
  1308. X
  1309. X    SUB
  1310. X    echo 'sub'
  1311. X    gosub SUB2
  1312. X    echo 'back to sub'
  1313. X    return
  1314. X
  1315. X
  1316. X    SUB2
  1317. X    echo 'sub2'
  1318. X    return
  1319. X
  1320. X
  1321. X
  1322. X
  1323. X    5.4.58  rk
  1324. X    usage: rk [-a]
  1325. X
  1326. X    This command invokes the Kermit file receive protocol.  If switch '-a'
  1327. X    is omitted,    the received files are stored as received; otherwise
  1328. X    carriage return/linefeed pairs are converted to newlines.  The remote
  1329. X    sender must    have been started prior    the the    execution of this command.
  1330. X
  1331. X
  1332. X    5.4.59  rlog
  1333. X
  1334. X    usage: rlog    [-srf] <str>
  1335. X       rlog    'off'
  1336. X
  1337. X
  1338. X    This command controls receiver logging.  It's function is the same as
  1339. X    the    interactive log    command.
  1340. X
  1341. X    The    first form of the command enables logging. The -
  1342. X    sswitchcausesthefiletobe scratched when it is opened (otherwise the    file
  1343. X    is opened for append).  The    -r switch causes raw logging, else filter
  1344. X    logging is performed.  The -f switch causes    the log    file to    be flushed
  1345. X    each time it is written to (unbuffered I/O); this switch is    useful if
  1346. X    you    are logging to a terminal or hard copy device and wish to see output
  1347. X    as soon as it is produced.
  1348. X
  1349. X
  1350. X
  1351. X
  1352. X
  1353. X
  1354. X
  1355. X    Public Domain by wht@n4hgf                 7/25/91
  1356. X
  1357. X
  1358. X
  1359. X
  1360. X
  1361. X
  1362. X
  1363. X    ECU    Technical Description                      78
  1364. X
  1365. X
  1366. X
  1367. X    5.4.60  rname
  1368. X    usage: rname <str>
  1369. X
  1370. X    Normally, the %rname string    function returns the same string as the
  1371. X    logical dialing directory entry.  This command allows the default value
  1372. X    to be overridden with a user-selected value    (63-character maximum).
  1373. X
  1374. X    This feature is useful in situations where one system is initially
  1375. X    dialed, but    a connection is    made to    yet another system from    the dialed
  1376. X    system via networking.
  1377. X
  1378. X
  1379. X    5.4.61  rs
  1380. X    usage: rs
  1381. X
  1382. X    This command invokes the SEAlink file receive protocol.  There is no
  1383. X    provision in the SEAlink protocol to convert carriage return/linefeed
  1384. X    pairs to newlines, so the received files are stored    as received.  The
  1385. X    remote sender must have been started prior the the execution of this
  1386. X    command.
  1387. X
  1388. X
  1389. X    5.4.62  rtscts
  1390. X    usage: rtscts [ off| on | no | yes | 0 | 1 | 2 | 3 ]
  1391. X
  1392. X    This SCO-only command control RTS/CTS hardware flow    control, which may
  1393. X    or may not work with your serial driver.  What the command does is to
  1394. X    manipulate the RTSFLOW and CTSFLOW bits of the termio c_cflag word (see
  1395. X    termio(S)).
  1396. X
  1397. X    As of this writing,     SCO's driver does half    duplex (traditional, brain
  1398. X    damaged) flow control if RTSFLOW is    enabled.  FAS does hardware flow
  1399. X    control based on the device    magic number, but if you use a device number
  1400. X    specifying no hardware flow    control, RTSFLOW and CTSFLOW can be used to
  1401. X    specify SCO-style flow control.  Advice: use rts on    or off for SCO,    use
  1402. X    appropriate    magic numbered device for FAS.
  1403. X
  1404. X
  1405. X     argument | RTSFLOW | CTSFLOW    argument | RTSFLOW | CTSFLOW
  1406. X     ---------+---------+---------    ---------+---------+---------
  1407. X       off      |   0        |    0      0     |   0       |   0
  1408. X       on      |   0        |    1      1     |   0       |   1
  1409. X       no      |   0        |    0      2     |   1       |   0
  1410. X       yes      |   1        |    1      3     |   1       |   1
  1411. X
  1412. X
  1413. X
  1414. X
  1415. X
  1416. X
  1417. X
  1418. X
  1419. X
  1420. X
  1421. X    Public Domain by wht@n4hgf                 7/25/91
  1422. X
  1423. X
  1424. X
  1425. X
  1426. X
  1427. X
  1428. X
  1429. X    ECU    Technical Description                      79
  1430. X
  1431. X
  1432. X
  1433. X    5.5     Integer Functions
  1434. X
  1435. X
  1436. X
  1437. X    5.5.1  %argc
  1438. X
  1439. X    This function returns the number of    arguments passes to the    current
  1440. X    procedure.
  1441. X
  1442. X
  1443. X
  1444. X
  1445. X    5.5.2  %baud
  1446. X
  1447. X    This function returns the baud rate    of the communications line.  If    no
  1448. X    line is currently attached,    the baud rate returned is the value of the
  1449. X    last line attached.     If no line has    been attached during the current
  1450. X    session, the default baud rate is returned.
  1451. X
  1452. X
  1453. X    5.5.3  %colors
  1454. X
  1455. X    This function returns the state of the normal and reverse video
  1456. X    foreground and background colors in    the 32-bit value:
  1457. X
  1458. X     00000000001111111111222222222233
  1459. X     01234567890123456789012345678901
  1460. X     0000|--|0000|--|0000|--|0000|--|
  1461. X          fg      bk      fg      bk
  1462. X           reverse        normal
  1463. X
  1464. X
  1465. X    The    color values are obtained from the following lists:
  1466. X
  1467. X
  1468. X
  1469. X
  1470. X
  1471. X
  1472. X
  1473. X
  1474. X
  1475. X
  1476. X
  1477. X
  1478. X
  1479. X
  1480. X
  1481. X
  1482. X
  1483. X
  1484. X
  1485. X
  1486. X
  1487. X    Public Domain by wht@n4hgf                 7/25/91
  1488. X
  1489. X
  1490. X
  1491. X
  1492. X
  1493. X
  1494. X
  1495. X    ECU    Technical Description                      80
  1496. X
  1497. X
  1498. X
  1499. X    Alphabetic Order
  1500. X    black         0
  1501. X    blue         1
  1502. X    brown         6
  1503. X    cyan         3
  1504. X    gray         8
  1505. X    green         2
  1506. X    hi_white    15
  1507. X    lt_blue         9
  1508. X    lt_cyan        11
  1509. X    lt_green    10
  1510. X    lt_magenta  13
  1511. X    lt_red        12
  1512. X    magenta         5
  1513. X    red         4
  1514. X    white         7
  1515. X    yellow        14
  1516. X
  1517. X
  1518. X
  1519. X    Numeric    Order
  1520. X    black         0
  1521. X    blue         1
  1522. X    green         2
  1523. X    cyan         3
  1524. X    red         4
  1525. X    magenta         5
  1526. X    brown         6
  1527. X    white         7
  1528. X    gray         8
  1529. X    lt_blue         9
  1530. X    lt_green    10
  1531. X    lt_cyan        11
  1532. X    lt_red        12
  1533. X    lt_magenta  13
  1534. X    yellow        14
  1535. X    hi_white    15
  1536. X
  1537. X
  1538. X
  1539. X    5.5.4  %cols
  1540. X
  1541. X    This function returns the screen width in columns.    If running non-
  1542. X    interactively, the value will always be 80.
  1543. X
  1544. X
  1545. X    5.5.5  %conn
  1546. X
  1547. X    This function returns the communications line file descriptor if a
  1548. X    connection is in progress, else 0.    NOTE:  if carrier is lost
  1549. X    abnormally,    %conn will return non-zero incorrectly.
  1550. X
  1551. X
  1552. X
  1553. X    Public Domain by wht@n4hgf                 7/25/91
  1554. X
  1555. X
  1556. X
  1557. X
  1558. X
  1559. X
  1560. X
  1561. X    ECU    Technical Description                      81
  1562. X
  1563. X
  1564. X
  1565. X    5.5.6  %curx
  1566. X
  1567. X    This function returns the display cursor column position last set by the
  1568. X    remote system.  This value does not    reflect    the actual hardware cursor.
  1569. X
  1570. X
  1571. X    5.5.7  %cury
  1572. X
  1573. X    This function returns the display cursor row position last set by the
  1574. X    remote system.  This value does not    reflect    the actual hardware cursor.
  1575. X
  1576. X
  1577. X    5.5.8  %csec
  1578. X
  1579. X    This function returns the number of    seconds    ECU has    been connected to a
  1580. X    remote system.  If ECU is not connected, zero is returned.
  1581. X
  1582. X
  1583. X    5.5.9  %ctoi
  1584. X
  1585. X    usage: %ctoi(str0)
  1586. X
  1587. X    This function returns the integer value of the first character in string
  1588. X    str0.  If str0 is non-empty, the return value will be between 0 and    255,
  1589. X    inclusive.    if str0    is empty, then -1 is returned.
  1590. X
  1591. X
  1592. X    5.5.10  %esecs
  1593. X
  1594. X    usage: %esecs
  1595. X
  1596. X    This function , "Epoch SECondS," returns the number    of seconds since
  1597. X    January 1, 1970 00:00 UTC (GMT).
  1598. X
  1599. X
  1600. X    5.5.11  %fatime
  1601. X
  1602. X    usage: %fatime(int0)
  1603. X       %fatime(str0)
  1604. X
  1605. X
  1606. X    This function returns the time of last access of the file referenced by
  1607. X    the    argument.  If the argument is an integer, the file referenced is the
  1608. X    file opened    by that    number with the    fopen command.    If the argument    is a
  1609. X    string, it is the literal filename.
  1610. X
  1611. X    If int0 does not refer to an open file, the    procedure terminates with an
  1612. X    error.  If the file    specified by str0 does not exist, -1 is    returned.
  1613. X
  1614. X    The    return value is    the number of seconds since January 1, 1970 at 0000
  1615. X    UTC.  The %edate string function may be used to convert the    integer
  1616. X
  1617. X
  1618. X
  1619. X    Public Domain by wht@n4hgf                 7/25/91
  1620. X
  1621. X
  1622. X
  1623. X
  1624. X
  1625. X
  1626. X
  1627. X    ECU    Technical Description                      82
  1628. X
  1629. X
  1630. X
  1631. X    value to a string representation of    the date and time expressed relative
  1632. X    to the current time    zone.
  1633. X
  1634. X
  1635. X    5.5.12  %fmode
  1636. X
  1637. X    usage: %fmode(int0)
  1638. X       %fmode(str0)
  1639. X
  1640. X
  1641. X    This function returns the file mode    value ("rwxrwx---" == 077) of the
  1642. X    file referenced by the argument.  If the argument is an integer, the
  1643. X    file referenced is the file    opened by that number with the fopen
  1644. X    command.  If the argument is a string, it is the literal filename.
  1645. X
  1646. X    If int0 does not refer to an open file, the    procedure terminates with an
  1647. X    error.  If the file    specified by str0 does not exist, -1 is    returned.
  1648. X
  1649. X
  1650. X    5.5.13  %fmtime
  1651. X
  1652. X    usage: %fmtime(int0)
  1653. X       %fmtime(str0)
  1654. X
  1655. X
  1656. X    This function returns the time of last modified of the file    referenced
  1657. X    by the argument.  If the argument is an integer, the file referenced is
  1658. X    the    file opened by that number with    the fopen command.  If the argument
  1659. X    is a string, it is the literal filename.
  1660. X
  1661. X    If int0 does not refer to an open file, the    procedure terminates with an
  1662. X    error.  If the file    specified by str0 does not exist, -1 is    returned.
  1663. X
  1664. X    The    return value is    the number of seconds since January 1, 1970 at 0000
  1665. X    UTC.  The %edate string function may be used to convert the    integer
  1666. X    value to a string representation of    the date and time expressed relative
  1667. X    to the current time    zone.
  1668. X
  1669. X
  1670. X    5.5.14  %fmode
  1671. X
  1672. X    usage: %fmode(int0)
  1673. X       %fmode(str0)
  1674. X
  1675. X
  1676. X    This function returns the size of the file referenced by the argument.
  1677. X    If the argument is an integer, the file referenced is the file opened by
  1678. X    that number    with the fopen command.     If the    argument is a string, it is
  1679. X    the    literal    filename.
  1680. X
  1681. X    If int0 does not refer to an open file, the    procedure terminates with an
  1682. X
  1683. X
  1684. X
  1685. X    Public Domain by wht@n4hgf                 7/25/91
  1686. X
  1687. X
  1688. X
  1689. X
  1690. X
  1691. X
  1692. X
  1693. X    ECU    Technical Description                      83
  1694. X
  1695. X
  1696. X
  1697. X    error.  If the file    specified by str0 does not exist, -1 is    returned.
  1698. X
  1699. X
  1700. X    5.5.15  %ftell
  1701. X
  1702. X    usage: ftell(int0)
  1703. X
  1704. X    This function returns the current file position of the the file opened
  1705. X    by int0 with the fopen command.
  1706. X
  1707. X    If int0 does not refer to an open file, the    procedure terminates with an
  1708. X    error.
  1709. X
  1710. X
  1711. X    5.5.16  %instr
  1712. X
  1713. X    usage: %instr(str0,str1)
  1714. X
  1715. X    This function returns the leftmost column position withing str0 that
  1716. X    str1 is found (zero    relative).  If str1 cannot be found in string str0,
  1717. X    -1 is returned.  However, if str1 is null and str0 is not, zero will be
  1718. X    returned (i.e., the    null string matches at the left).
  1719. X
  1720. X    The    comparison is made without regard to case. See also %instr.
  1721. X
  1722. X
  1723. X     Examples:
  1724. X
  1725. X             00000000001111111
  1726. X             01234567890123456
  1727. X     Assume    $s0='abcdefghijklmnabc'
  1728. X        $s1='abc'
  1729. X        $s2='gHi'
  1730. X        $s3='cat'
  1731. X
  1732. X        %instr($s0,$s1)           returns 0
  1733. X        %instr($s0,$s2)           returns 6
  1734. X        %instr($s0,$s3)           returns -1
  1735. X        %instr($s0,'bcd')      returns 2
  1736. X        %instr($s0,'bad')      returns -1
  1737. X
  1738. X
  1739. X
  1740. X    5.5.17  %ischr
  1741. X
  1742. X    usage: %ischr(int0)
  1743. X       %ischr(str0)
  1744. X
  1745. X
  1746. X    This function returns 1 if the file    referenced by the argument is a
  1747. X    character special file, else 0.  If    the argument is    an integer, the    file
  1748. X
  1749. X
  1750. X
  1751. X    Public Domain by wht@n4hgf                 7/25/91
  1752. X
  1753. X
  1754. X
  1755. X
  1756. X
  1757. X
  1758. X
  1759. X    ECU    Technical Description                      84
  1760. X
  1761. X
  1762. X
  1763. X    referenced is the file opened by that number with the fopen    command.  If
  1764. X    the    argument is a string, it is the    literal    filename.
  1765. X
  1766. X    If int0 does not refer to an open file, the    procedure terminates with an
  1767. X    error.  If the file    specified by str0 does not exist, -1 is    returned.
  1768. X
  1769. X    Examples:
  1770. X
  1771. X
  1772. X     %ischr('/dev/tty')    returns 1
  1773. X     %ischr('/usr/bin')    returns 0
  1774. X     %ischr('/xenix')      returns 0
  1775. X
  1776. X
  1777. X
  1778. X    5.5.18  %isdir
  1779. X
  1780. X    usage: %isdir(int0)
  1781. X       %isdir(str0)
  1782. X
  1783. X
  1784. X    This function returns 1 if the file    referenced by the argument is a
  1785. X    directory file, else 0.  If    the argument is    an integer, the    file
  1786. X    referenced is the file opened by that number with the fopen    command.  If
  1787. X    the    argument is a string, it is the    literal    filename.
  1788. X
  1789. X    If int0 does not refer to an open file, the    procedure terminates with an
  1790. X    error.  If the file    specified by str0 does not exist, -1 is    returned.
  1791. X
  1792. X    Examples:
  1793. X
  1794. X
  1795. X     %isdir('/dev/tty')    returns 0
  1796. X     %isdir('/usr/bin')    returns 1
  1797. X     %isdir('/xenix')      returns 0
  1798. X
  1799. X
  1800. X
  1801. X    5.5.19  %isreg
  1802. X
  1803. X    usage: %isreg(int0)
  1804. X       %isreg(str0)
  1805. X
  1806. X
  1807. X    This function returns 1 if the file    referenced by the argument is a
  1808. X    regular file, else 0.  If the argument is an integer, the file
  1809. X    referenced is the file opened by that number with the fopen    command.  If
  1810. X    the    argument is a string, it is the    literal    filename.
  1811. X
  1812. X    If int0 does not refer to an open file, the    procedure terminates with an
  1813. X    error.  If the file    specified by str0 does not exist, -1 is    returned.
  1814. X
  1815. X
  1816. X
  1817. X    Public Domain by wht@n4hgf                 7/25/91
  1818. X
  1819. X
  1820. X
  1821. X
  1822. X
  1823. X
  1824. X
  1825. X    ECU    Technical Description                      85
  1826. X
  1827. X
  1828. X
  1829. X    Examples:
  1830. X
  1831. X
  1832. X     %isreg('/dev/tty')    returns 0
  1833. X     %isreg('/usr/bin')    returns 0
  1834. X     %isreg('/xenix')      returns 1
  1835. X
  1836. X
  1837. X
  1838. X    5.5.20  %len
  1839. X
  1840. X    usage: %len(str0)
  1841. X
  1842. X    This function returns the length of    str0.
  1843. X
  1844. X     Example:
  1845. X
  1846. X     set str0='abcdef',i0=%len(str0),i1=%len('1234')
  1847. X     str00 = 'abcdef'
  1848. X     int00 = 6
  1849. X     int01 = 4
  1850. X
  1851. X
  1852. X
  1853. X    5.5.21  %lgetc
  1854. X
  1855. X    usage: %lgetc
  1856. X
  1857. X    Reads a character from the line and    returns    it.
  1858. X
  1859. X
  1860. X    5.5.22  %lines
  1861. X
  1862. X    This function returns the screen height in lines.  If running non-
  1863. X    interactively, the value will always be 25.
  1864. X
  1865. X
  1866. X    5.5.23  %nice
  1867. X
  1868. X    usage: %nice
  1869. X
  1870. X    This function returns the nice value of the    ECU process.
  1871. X
  1872. X
  1873. X    5.5.24  %pid
  1874. X
  1875. X    This function returns the process id (pid) of ECU.
  1876. X
  1877. X
  1878. X
  1879. X
  1880. X
  1881. X
  1882. X
  1883. X    Public Domain by wht@n4hgf                 7/25/91
  1884. X
  1885. X
  1886. X
  1887. X
  1888. X
  1889. X
  1890. X
  1891. X    ECU    Technical Description                      86
  1892. X
  1893. X
  1894. X
  1895. X    5.5.25  %match
  1896. X
  1897. X    usage: %match(str0,str1)
  1898. X
  1899. X    This function searches string str0 for a match with    the regular
  1900. X    expression in str1 (for information    on regular expressions,    refer to the
  1901. X    ed(C) manual pages).  The function returns the index into str0 where the
  1902. X    match is found or -1 if no match can be found.  The    matching process is
  1903. X    case sensitive.
  1904. X
  1905. X    The    variable $i0 receives the length of the    matching string    in str0    if a
  1906. X    match is found.  For this reason, it is not    advisable that $i0 otherwise
  1907. X    be involved    in the operation.  Specifically    to be avoided is:
  1908. X
  1909. X     set $i0=%instr(...)
  1910. X
  1911. X    Examples:
  1912. X
  1913. X        00000000001111111
  1914. X        01234567890123456
  1915. X    Assume $s0='abcdefghijklmnabc'
  1916. X       $s1='abc'
  1917. X       $s2='n.*'
  1918. X
  1919. X       %match($s0,$s1)      returns 0   $i0=3
  1920. X       %match($s0,$s2)      returns 16  $i0=4
  1921. X       %match($s0,$s3)      returns -1  $i0 unchanged
  1922. X       %match($s0,'de..h')      returns 3   $i0=5
  1923. X       %match($s0,'de..H')      returns -1  $i0 unchanged
  1924. X
  1925. X
  1926. X
  1927. X    5.5.26  %mhack
  1928. X
  1929. X    usage: %mhack
  1930. X
  1931. X    This function ("Millisecond    time HACK") returns the    number of
  1932. X    milliseconds since ecu was started.     It isn't a very useful    value by
  1933. X    itself, but    differences between the    values returned    by two calls to    the
  1934. X    function may be used to determine the time between two events with the
  1935. X    maximum accuracy the operating system can deliver (1/HZ resolution with
  1936. X    a bit of latency).
  1937. X
  1938. X
  1939. X    Examples:
  1940. X    $i10 = %mhack
  1941. X    send 'test'
  1942. X    lookfor    -e %chr(0x0A) 100
  1943. X    ifi $i0    == 0 echo 'no response in 10 seconds'
  1944. X    else echo 'response time '+%itos(%mhack    - $i10)+' msec'
  1945. X
  1946. X
  1947. X
  1948. X
  1949. X    Public Domain by wht@n4hgf                 7/25/91
  1950. X
  1951. X
  1952. X
  1953. X
  1954. X
  1955. X
  1956. X
  1957. X    ECU    Technical Description                      87
  1958. X
  1959. X
  1960. X
  1961. X    5.5.27  %rchr
  1962. X
  1963. X    This function returns the number of    characters received by ECU since the
  1964. X    program starrted.
  1965. X
  1966. X
  1967. X    5.5.28  %rchrc
  1968. X
  1969. X    This function returns the number of    characters received by ECU during
  1970. X    the    current    connection.
  1971. X
  1972. X
  1973. X    5.5.29  %rinstr
  1974. X
  1975. X    usage: %rinstr(str0,str1)
  1976. X
  1977. X    This function returns the rightmost    column position    withing    str0 that
  1978. X    str1 is found (zero    relative).  If str1 cannot be found in string str0,
  1979. X    -1 is returned.  However, if str1 is null and str0 is not, zero will be
  1980. X    returned (i.e., the    null string matches at the left).
  1981. X
  1982. X    The    comparison is made without regard to case. See also %instr.
  1983. X
  1984. X
  1985. X     Examples:
  1986. X
  1987. X             00000000001111111
  1988. X             01234567890123456
  1989. X     Assume    $s0='abcdefghijklmnabc'
  1990. X        $s1='abc'
  1991. X        $s2='gHi'
  1992. X        $s3='cat'
  1993. X
  1994. X        %instr($s0,$s1)           returns 14
  1995. X        %instr($s0,$s2)           returns 6
  1996. X        %instr($s0,$s3)           returns -1
  1997. X
  1998. X
  1999. X
  2000. X    5.5.30  %shmid
  2001. X
  2002. X    This function returns the integer shared memory segment id for the
  2003. X    current ECU    process.  It may be used to pass the id    to a "friend"
  2004. X    process so that it may access the shared memory segment (described in
  2005. X    header file    ecushm.h).  For    more details, refer to an earlier section
  2006. X    entitled "Shared Memory 'Friend' Interface."
  2007. X
  2008. X
  2009. X
  2010. X
  2011. X
  2012. X
  2013. X
  2014. X
  2015. X    Public Domain by wht@n4hgf                 7/25/91
  2016. X
  2017. X
  2018. X
  2019. X
  2020. X
  2021. X
  2022. X
  2023. X    ECU    Technical Description                      88
  2024. X
  2025. X
  2026. X
  2027. X    Example:
  2028. X
  2029. X     system    'ecufriend '+%itos(%shmid)
  2030. X
  2031. X
  2032. X
  2033. X    5.5.31  %stoi
  2034. X
  2035. X    usage: %stoi(str0)
  2036. X
  2037. X    This function converts the contents    of str0    to an integer and returns
  2038. X    the    value.
  2039. X
  2040. X
  2041. X    5.5.32  %uid
  2042. X
  2043. X    usage: %uid
  2044. X
  2045. X    This function returns the uid of the user.
  2046. X
  2047. X
  2048. X    5.5.33  %xchr
  2049. X
  2050. X    This function returns the number of    characters transmitted by ECU since
  2051. X    the    program    starrted.
  2052. X
  2053. X
  2054. X    5.5.34  %xchrc
  2055. X
  2056. X    This function returns the number of    characters transmitted by ECU during
  2057. X    the    current    connection.
  2058. X
  2059. X
  2060. X
  2061. X
  2062. X    5.6     String    Functions
  2063. X
  2064. X
  2065. X
  2066. X    5.6.1  %argv
  2067. X
  2068. X    usage: %argv(int0)
  2069. X
  2070. X    This function returns the string value of an argument passed to the
  2071. X    procedure by the 'do' command.  Argument 0 is the name of the procedure
  2072. X    itself.  The integer function %argc    may be used to determine the number
  2073. X    of arguments passed    to the procedure.  Specifying an argument number
  2074. X    greater than the number of arguments passed    returns    a null string (if
  2075. X    procedure tracing is enabled with the 'ptrace' comand, a warning will be
  2076. X    displayed in this case).
  2077. X
  2078. X
  2079. X
  2080. X
  2081. X    Public Domain by wht@n4hgf                 7/25/91
  2082. X
  2083. X
  2084. X
  2085. X
  2086. X
  2087. X
  2088. X
  2089. X    ECU    Technical Description                      89
  2090. X
  2091. X
  2092. X
  2093. X     Example:
  2094. X         invocation    from shell:
  2095. X         ecu -p test Quick Brown Fox
  2096. X
  2097. X         invocation    from interactive command line:
  2098. X         do    test Quick Brown Fox
  2099. X
  2100. X         invocation    from procedure:
  2101. X         do    'test' 'Quick' 'Brown' 'Fox'
  2102. X
  2103. X         results in:
  2104. X         %argv(0) =    'test'
  2105. X         %argv(1) =    'Quick'
  2106. X         %argv(2) =    'Brown'
  2107. X         %argv(3) =    'Fox'
  2108. X         %argv(4) =    ''
  2109. X
  2110. X
  2111. X    NOTE: the interactive dial command,    the dialing directory menu and the
  2112. X    initial setup menu all can automatically execute a procedure which
  2113. X    matches a dialed logical telephone number.    There two arguments passed
  2114. X    to these procedures, %argv(0) being    the procedure name as always.
  2115. X    %argv(1) is    set according to the following table:
  2116. X
  2117. X      invoker           %argv(1)
  2118. X     -------------------  -------------
  2119. X     initial setup menu   !INITIAL
  2120. X     interactive dial     !INTERACTIVE
  2121. X     dialing menu          !MENU
  2122. X
  2123. X    Thus it is possible    for the    invoked    procedure to determine that it has
  2124. X    been automatically executed    by testing %argv(1) for    an exclamation
  2125. X    point, or possibly the entire argument.
  2126. X
  2127. X
  2128. X    5.6.2  %basename
  2129. X
  2130. X    Usage: %basename(str0,str1)
  2131. X
  2132. X    This function is similar to    the UNIX basename(1) utility in    that it
  2133. X    returns a filename minus a supplied    suffix,    if it is present.  Unlike
  2134. X    the    UNIX basename(C) program, %basename does not remove the    directory
  2135. X    part of the    filename.  See also %dirpart and %filepart.
  2136. X
  2137. X
  2138. X    Examples:
  2139. X
  2140. X    %basename('/u1/src/ecu/ecu.c','.c') = /u1/src/ecu/ecu
  2141. X    %basename('ecu.c','.c')    = ecu
  2142. X    %basename('ecu.c','.x')    = ecu.c
  2143. X
  2144. X
  2145. X
  2146. X
  2147. X    Public Domain by wht@n4hgf                 7/25/91
  2148. X
  2149. X
  2150. X
  2151. X
  2152. X
  2153. X
  2154. X
  2155. X    ECU    Technical Description                      90
  2156. X
  2157. X
  2158. X
  2159. X    5.6.3  %cgetc
  2160. X
  2161. X    usage: %cgetc
  2162. X
  2163. X    This  function reads one character from the    console    keyboard and returns
  2164. X    it.     The character is not echoed.
  2165. X
  2166. X
  2167. X    5.6.4  %cgets
  2168. X
  2169. X    usage: %cgets
  2170. X
  2171. X    This function reads    a string from the console keyboard and returns it.
  2172. X    Each character is echoed as    it is typed and    the user's normal erase    and
  2173. X    kill character is available    to edit    the input before terminating the
  2174. X    read with ENTER.
  2175. X
  2176. X
  2177. X    5.6.5  %chr
  2178. X
  2179. X    usage: %chr(int0)
  2180. X
  2181. X    This function returns the character    value whose ASCII value    is supplied
  2182. X    in int0.
  2183. X
  2184. X
  2185. X    Example:
  2186. X
  2187. X    set $s0    = %chr(4)  places a ^D (EOT) character into $s0
  2188. X
  2189. X
  2190. X
  2191. X    5.6.6  %date
  2192. X
  2193. X    usage: %date
  2194. X
  2195. X    This function returns the current date in the form 'mm-dd-yyyy' in the
  2196. X    local time zone (daylight time if it applies).
  2197. X
  2198. X
  2199. X    5.6.7  %datez
  2200. X
  2201. X    usage: %datez
  2202. X
  2203. X    This function returns the current date in the form 'mm-dd-yyyy' in the
  2204. X    UTC    (Z) time zone.
  2205. X
  2206. X
  2207. X    5.6.8  %day
  2208. X
  2209. X    usage: %day
  2210. X
  2211. X
  2212. X
  2213. X    Public Domain by wht@n4hgf                 7/25/91
  2214. X
  2215. X
  2216. X
  2217. X
  2218. X
  2219. X
  2220. X
  2221. X    ECU    Technical Description                      91
  2222. X
  2223. X
  2224. X
  2225. X    This function returns the current day of the week as a three character
  2226. X    abbreviation: 'Sun', 'Mon',    'Tue', 'Wed', 'Thu', 'Fri', 'Sat' in the
  2227. X    local time zone (daylight time if it applies).
  2228. X
  2229. X
  2230. X    5.6.9  %dayz
  2231. X
  2232. X    usage: %dayz
  2233. X
  2234. X    This function returns the current day of the week as a three character
  2235. X    abbreviation: 'Sun', 'Mon',    'Tue', 'Wed', 'Thu', 'Fri', 'Sat' in the UTC
  2236. X    (Z)    time zone.
  2237. X
  2238. X
  2239. X    5.6.10  %dir
  2240. X
  2241. X    usage: %dir
  2242. X
  2243. X    This function returns the full pathname of the current working
  2244. X    directory.
  2245. X
  2246. X
  2247. X    5.6.11  %dirpart
  2248. X
  2249. X    usage: %dirpart(str0)
  2250. X
  2251. X    This function returns the directory    portion    of the pathname    supplied in
  2252. X    str0.  See also %basename and %filepart.
  2253. X
  2254. X
  2255. X
  2256. X    Examples:
  2257. X
  2258. X    %dirpart('/u1/src/src/foo.c') = "/u1/src/src"
  2259. X    %dirpart('foo.c') =    "foo.c"
  2260. X    %dirpart('/usr') = ""
  2261. X
  2262. X
  2263. X
  2264. X    5.6.12  %edate
  2265. X
  2266. X    usage: %edate(int0)
  2267. X
  2268. X    The    value in int0 is expected to be    a number of seconds since January 1,
  2269. X    1970 00:00 UTC (Universal Coordinated Time)    as returned by the integer
  2270. X    functions %fatime and %fmtime.  This function converts the value into a
  2271. X    string representing    the equivalent local time in the form 'mm-dd-yyyy
  2272. X    hh:mm:ss'.
  2273. X
  2274. X
  2275. X
  2276. X
  2277. X
  2278. X
  2279. X    Public Domain by wht@n4hgf                 7/25/91
  2280. X
  2281. X
  2282. X
  2283. X
  2284. X
  2285. X
  2286. X
  2287. X    ECU    Technical Description                      92
  2288. X
  2289. X
  2290. X
  2291. X    Example:
  2292. X
  2293. X    set    $i0=%fmtime('/xenix')
  2294. X    $i00 = 601178971 (0x23d5435b,04365241533)
  2295. X
  2296. X    set    $s0=%edate($i0)
  2297. X    $s00 = '01-18-1989 21:09:31'
  2298. X
  2299. X
  2300. X
  2301. X    5.6.13  %envvar
  2302. X
  2303. X    usage: %envvar()
  2304. X
  2305. X    This function returns the string value of an environment variable.
  2306. X
  2307. X
  2308. X    Example:
  2309. X
  2310. X    set $s0=%envvar('HOME')    might set $s0 '/usr/user'
  2311. X
  2312. X    Typical Environment    Variables:
  2313. X
  2314. X    HOME          pathname of home directory
  2315. X    EDITOR          user's preferred editor
  2316. X    PATH          program execution    searchlist
  2317. X    TERM          terminal type
  2318. X    SHELL          user's preferred shell
  2319. X    MAIL          user's mail box file
  2320. X    ECUPROMPT     ECU interactive command prompt
  2321. X              at beginning of execution
  2322. X
  2323. X
  2324. X
  2325. X    5.6.14  %errstr
  2326. X
  2327. X    usage: %errstr(int0)
  2328. X
  2329. X    This function returns the system error message, given int0 as an errno
  2330. X    as returned    by a file-related command.  fopen.
  2331. X
  2332. X
  2333. X    Example:
  2334. X
  2335. X    echo %errstr(1)
  2336. X    Not owner
  2337. X
  2338. X
  2339. X
  2340. X
  2341. X
  2342. X
  2343. X
  2344. X
  2345. X    Public Domain by wht@n4hgf                 7/25/91
  2346. X
  2347. X
  2348. X
  2349. X
  2350. X
  2351. X
  2352. X
  2353. X    ECU    Technical Description                      93
  2354. X
  2355. X
  2356. X
  2357. X    5.6.15  %etime
  2358. X
  2359. X    usage: %etime(int0)
  2360. X
  2361. X    This function returns a string representation of elapsed time in the
  2362. SHAR_EOF
  2363. true || echo 'restore of doc/ecu.man failed'
  2364. fi
  2365. echo 'End of ecuman310 part 3'
  2366. echo 'File doc/ecu.man is continued in part 4'
  2367. echo 4 > _shar_seq_.tmp
  2368. exit 0
  2369. --------------------------------------------------------------------
  2370. Warren Tucker, TuckerWare emory!n4hgf!wht or wht@n4hgf.Mt-Park.GA.US
  2371. Hacker Extraordinaire  d' async PADs,  pods,  proteins and protocols
  2372.  
  2373. exit 0 # Just in case...
  2374. -- 
  2375. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  2376. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  2377. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  2378. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  2379.