RUNSCRIPT(1)
π 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"'
- regular text, e.g.
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 withgotoorgosubπ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 thegosub. gosub's can be nested, so go wild πreturnβ return from agosubβ! <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. thestdoutoutput 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. (default1)set <variable> <value>β sets the value of <variable> (which is a single lettera-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 anexpect, because the default action oftimeoutis 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
- alpine 3.22: minicom-doc 2.10-r0 Β· GPL-2.0-or-later
- alpine 3.23: minicom-doc 2.10-r0 Β· GPL-2.0-or-later
- alpine 3.24: minicom-doc 2.10-r0 Β· GPL-2.0-or-later
- arch rolling: minicom 2.11.1-3 Β· GPL-2.0-or-later
- centos-stream 10: minicom 2.9-5.el10 Β· GPL-2.0-or-later AND LGPL-2.0-or-later AND LicenseRef-Fedora-Public-Domain
- debian bookworm: minicom 2.8-2
- debian trixie: minicom 2.10-1
- fedora 43: minicom 2.11.1-1.fc43 Β· GPL-2.0-or-later AND LGPL-2.0-or-later AND LicenseRef-Fedora-Public-Domain
- fedora 43: minicom 2.9-5.fc43 Β· GPL-2.0-or-later AND LGPL-2.0-or-later AND LicenseRef-Fedora-Public-Domain
- fedora 44: minicom 2.10-2.fc44 Β· GPL-2.0-or-later AND LGPL-2.0-or-later AND LicenseRef-Fedora-Public-Domain
- fedora 44: minicom 2.11.1-1.fc44 Β· GPL-2.0-or-later AND LGPL-2.0-or-later AND LicenseRef-Fedora-Public-Domain
- nixos 26.05: minicom 2.10
- nixpkgs unstable: minicom 2.11.1
- opensuse-leap 16.0: minicom 2.11.1-bp160.1.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: minicom 2.11.1-bp160.1.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: minicom 2.11.1-bp160.1.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: minicom 2.11.1-bp160.1.1 Β· GPL-2.0-or-later
- ubuntu jammy: minicom 2.8-2
- ubuntu noble: minicom 2.9-4
- ubuntu questing: minicom 2.10-1
- ubuntu resolute: minicom 2.10-1ubuntu1
- ubuntu stonking: minicom 2.11.1-2 Β· GPL-2.0-or-later
- Copyright 1992,93,94 Miquel van Smoorenburg
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms