home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 3 Comm / 03-Comm.zip / mincom15.zip / Manual.scr < prev    next >
Text File  |  1993-04-22  |  4KB  |  125 lines

  1.         Manual for "runscript"
  2.  
  3. In this package, a simple script-interpreter is included. It can
  4. be used to login to other systems and things like that.
  5. Try running the demo:
  6.  
  7.     runscript scriptdemo
  8.  
  9. for fun.
  10.  
  11. Runscript reckognizes the following keywords:
  12.  
  13. expect    send      !         goto      gosub     return
  14. exit      print     set       inc       dec       if
  15. timeout   verbose   sleep     break     call
  16.  
  17. The program expects that it's standard input and standard output are
  18. connected to the "remote end", that is the modem port, and that it
  19. can write to the local screen through standard error. This is naturally
  20. the case when you run it from within minicom.
  21. The next statements can be used:
  22.  
  23. send <string>
  24.   <string> is sent to the modem. It is followed by a "\r". <string> can be:
  25.   - regular text, eg 'send hello'
  26.   - text enclosed in quotes, eg 'send "hello world"'
  27.   - and within <string> the following escape sequences are reckognized:
  28.     \n - newline
  29.     \r - carriage return
  30.     \a - bell
  31.     \b - backspace
  32.     \c - don't send the default '\r'.
  33.     \f - formfeed
  34.     and \ooo can be used to send an arbitrary character, where ooo is
  35.     an octal number.
  36.     Also $(environment_variable) can be used, for example $(TERM).
  37.     Minicom passes two special environment variables: $(LOGIN), which is the
  38.     username, and $(PASS), which is the password, as defined in the proper
  39.     entry of the dialing directory.
  40.  
  41. print <string>
  42.   Prints <string> to the local screen. Default followed by '\r\n'.
  43.   See the description of 'send' above.
  44.  
  45. label:
  46.   Declares a label (with the name 'label') to use with goto or gosub.
  47.  
  48. goto <label>
  49.   Jump to another place in the program.
  50.  
  51. gosub <label>
  52.   Jumps to another place in the program. When the statement 'return'
  53.   is encountered, control returns to the statement after the gosub.
  54.   Gosub's can be nested.
  55.  
  56. return
  57.   Return from a gosub.
  58.  
  59. ! <command>
  60.   Runs a shell for you in which 'command' is executed. On return,
  61.   the variable '$?' is set to the exit status of this command,
  62.   so you can subsequently test it using 'if'.
  63.  
  64. exit [value]
  65.   Exit from "runscript" with an optional exit status. (default 1)
  66.  
  67. set <variable> <value>
  68.   Sets the value of <variable> (which is a single letter a-z) to the
  69.   value <value>. If <variable> does not exist, it will be created.
  70.   <value> can be a integer value or another variable.
  71.  
  72. inc <variable>
  73.   Increments the value of <vaiable> by one.
  74.  
  75. dec <variable>
  76.   Decrements the value of <variable> by one.
  77.  
  78. if <value> <operator> <value> <statement>
  79.   Conditional execution of <statement>. <operator> can be <, > or =.
  80.   Eg, 'if a > 3 goto exitlabel'.
  81.  
  82. timeout <value>
  83.   Sets the global timeout. By default, 'runscript' will exit after
  84.   120 seconds. This can be changed with this command. Warning: this
  85.   command acts differently within an 'expect' statement, but more
  86.   about that later.
  87.  
  88. verbose <on|off>
  89.   By default, this is 'on'. That means that anything that is being
  90.   read from the modem by 'runscript', gets echoed to the screen.
  91.   This is so that you can see what 'runscript' is doing.
  92.  
  93. sleep <value>
  94.   Suspend execution for <value> seconds.
  95.  
  96. expect {
  97.   pattern  [statement]
  98.   pattern  [statement]
  99.   [timeout <value> [statement] ]
  100.   ....
  101. }
  102.   The most important command of all. Expect keeps reading from the input
  103.   until it reads a pattern that matches one of the specified ones.
  104.   If expect encounters an optional statement after that pattern, it
  105.   will execute it. Otherwise the default is to just break out of the
  106.   expect. 'pattern' is a string, just as in 'send' (see above).
  107.   Normally, expect will timeout in 60 seconds and just exit, but this
  108.   can be changed with the timeout command.
  109.  
  110. break
  111.   Break out of an 'expect' statement. This is normally only useful
  112.   as argument to 'timeout' within an expect, because the default
  113.   action of timeout is to exit immediately.
  114.  
  115. call <scriptname>
  116.   Transfers control to another scriptfile. When that scriptfile
  117.   finishes without errors, the original script will continue.
  118.  
  119. Well, I don't think this is enough information to make you an
  120. experienced 'programmer' :-) in 'runscript', but together with the
  121. examples it shouldn't be too hard to write some useful script
  122. files. Things will be easier if you have experience with BASIC :-)
  123.  
  124. Miquel.
  125.