RUNSCRIPT(1)

πŸ“¦
version 2.11.1 Β· 2 versions
  • 2.11.1 Β· alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, debian bookworm, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 2.7.1 Β· centos-stream 9
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, debian bookworm, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– RUNSCRIPT(1) πŸ’–

ok so bestie, this is the manual for runscript, a lil script interpreter for minicom β€” and yes it lives in section 1 of the General Commands Manual, iykyk 🫢


✨ NAME ✨

runscript β€” script interpreter for minicom πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

runscript scriptname [logfile [homedir]]

🌸 DESCRIPTION 🌸

runscript is a simple script interpreter that can be called from inside the minicom communications program, so you can automate stuff like logging in to a Unix system or your fave BBS. it's giving hands-free main character energy ✨ no cap.


πŸ¦‹ INVOCATION πŸ¦‹

so the program expects a script name, and optionally a filename and the user's home directory as arguments. and it expects that its input and output are connected to the "remote end" β€” that's the system you're connecting to, babe πŸ’«

every message from runscript that's meant for the local screen gets directed to the stderr output. and all of this is automatically taken care of if you run it from minicom, so don't stress πŸ’…

the logfile and home directory parameters are only used to tell the log command the name of the logfile and where to write it. if the homedir is omitted, runscript uses the directory found in the $HOME environment variable. and if the logfile name is also omitted, the log commands are just… ignored πŸ™ˆ


πŸ‘‘ KEYWORDS πŸ‘‘

runscript recognizes the following commands:

expect   send     goto     gosub    return   !<   !
exit     print    set      inc      dec      if   timeout
verbose  sleep    break    call     log

🌈 OVERVIEW OF KEYWORDS 🌈

  • send <string> β€” sends <string> to the modem. it's followed by a '\r'. <string> can be:
    • regular text, e.g. 'send hello'
    • text enclosed in quotes, e.g. 'send "hello world"'

within <string> these sequences are recognized, periodt:

\n - newline
\r - carriage return
\a - bell
\b - backspace
\c - don't send the default '\r'.
\f - formfeed
\^ - the ^ character
\o - send character o (o is an octal number)

control characters can be used in the string with the ^ prefix (^A to ^Z, ^[, ^ ^], ^^ and ^_). if you need to send the ^ character itself, you gotta prefix it with the \ escape character, bestie ✨

octal characters are either four-digit or delimited by a non-digit character. e.g. the null character may be sent with \0000, and 'send 1234' is equivalent to 'send \0061234'.

also $(environment_variable) can be used, for example $(TERM) πŸ“

minicom passes three special environment variables: $(LOGIN), which is the username, $(PASS), which is the password, as defined in the proper entry of the dialing directory, and $(TERMLIN) which is the number of actual terminal lines on your screen (that is, the statusline excluded).

  • print <string> β€” prints <string> to the local screen. default followed by '\r\n'. see the description of 'send' above πŸ’–
  • label: β€” declares a label (with the name 'label') to use with goto or gosub πŸŽ€
  • goto <label> β€” jump to another place in the program πŸ¦‹
  • gosub <label> β€” jumps to another place in the program. when the statement 'return' is encountered, control returns to the statement after the gosub. gosub's can be nested, so go wild πŸ’…
  • return β€” return from a gosub ⭐
  • ! <command> β€” runs a shell for you in which 'command' is executed. on return, the variable '$?' is set to the exit status of this command, so you can subsequently test it using 'if' πŸ”₯
  • !< <command> β€” runs a shell for you in which 'command' is executed. the stdout output of the command execution will be sent to the modem. on return, the variable '$?' is set to the exit status of this command, so you can subsequently test it using 'if' πŸ”₯
  • exit [value] β€” exit from "runscript" with an optional exit status. (default 1)
  • set <variable> <value> β€” sets the value of <variable> (which is a single letter a-z) to the value <value>. if <variable> does not exist, it will be created. <value> can be a integer value or another variable πŸ’œ
  • inc <variable> β€” increments the value of <variable> by one ⬆️
  • dec <variable> β€” decrements the value of <variable> by one ⬇️
  • if <value> <operator> <value> <statement> β€” conditional execution of <statement>. <operator> can be <, >, != or =. eg, 'if a > 3 goto exitlabel' πŸ€”
  • timeout <value> β€” sets the global timeout. by default, 'runscript' will exit after 120 seconds. this can be changed with this command.
⚠️ warning: this command acts differently within an 'expect' statement, but more about that later πŸ‘€
  • verbose <on|off> β€” by default, this is 'on'. that means that anything that is being read from the modem by 'runscript', gets echoed to the screen. this is so that you can see what 'runscript' is doing πŸ‘‘
  • sleep <value> β€” suspend execution for <value> seconds 😴
  • expect
expect {
  pattern  [statement]
  pattern  [statement]
  [timeout <value> [statement] ]
  ....
}

the most important command of all. expect keeps reading from the input until it reads a pattern that matches one of the specified ones. if expect encounters an optional statement after that pattern, it will execute it. otherwise the default is to just break out of the expect. 'pattern' is a string, just as in 'send' (see above). normally, expect will timeout in 60 seconds and just exit, but this can be changed with the timeout command ✨

  • break β€” break out of an 'expect' statement. this is normally only useful as argument to 'timeout' within an expect, because the default action of timeout is to exit immediately πŸ’€
  • call <scriptname> β€” transfers control to another script file. when that script file finishes without errors, the original script will continue 🧚
  • log <text> β€” write text to the logfile πŸ“

🌟 NOTES 🌟

if you want to make your script exit minicom (for example when you use minicom to dial up your ISP, and then start a PPP or SLIP session from a script), try the command "! killall -9 minicom" as the last script command. the -9 option should prevent minicom from hanging up the line and resetting the modem before exiting πŸ”₯

well, I don't think this is enough information to make you an experienced 'programmer' in 'runscript', but together with the examples it shouldn't be too hard to write some useful script files. things will be easier if you have experience with BASIC. the minicom source code comes together with two example scripts, scriptdemo and unixlogin. especially the last one is a good base to build on for your own scripts πŸ’–


πŸ” SEE ALSO πŸ”


πŸ’€ BUGS πŸ’€

Runscript should be built in to minicom. that's it, that's the bug πŸ™ˆ


🌸 AUTHOR 🌸

Miquel van Smoorenburg, <miquels@drinkel.ow.org> Jukka Lahtinen, <walker@netsonic.fi> πŸ’œ


ok that's the whole thing bestie, you ate 🫢 and just so you know this page is from the User's Manual and its date stamp is $Date: 2007-10-07 18:13:51 $ β€” iconic, vintage, slay βœ¨πŸŽ€πŸ’…

πŸ“¦ where this page comes from