exec
ARES System Manual: exec Shell
(input)
The system shell may be changed by modifying the database value
Several useful commands are built-in to
When ARES documentation refers to 'invoking' a system command, or running a system command directly, this indicates that
In Companion, a similar utility called
Variable Substitution
To create or modify a variable, use the set built-in. Note that the environment is global: any command run on your system shares the same pool of variables, with the exception of certain built-ins:
The following variable names are reserved and will always return special values regardless of how they are set in
-
-
-
-
Variable substitutions are only parsed within system command calls; they cannot be used in direct speech or aliases. To work around this, use say, e.g.
exec <filename>: Runs the specified file using extension associations.
exec do <filename>: Interprets the specified text file as a shell script.
exec <...>: Runs the specified command <...>.
(input)
@<...>: Triggers exec.
exec is the main ARES shell. When the user or unit types a message into input, if that message starts with @, then the @ sign is removed and the rest of the command is sent to exec for further processing. exec also runs .as (ARES Shell) script files.
The system shell may be changed by modifying the database value
input.shell and restarting input. However, in this manual, whenever a command syntax definition begins with '(input) @...', it is assumed to be a call to the default system shell implemented by exec.
Several useful commands are built-in to
exec, and are used to controlling scripts and perform other system functions; see: alias, do, echo, exit, from, if, jump, say, set, service, to.
When ARES documentation refers to 'invoking' a system command, or running a system command directly, this indicates that
exec is NOT being used; to gain access to aliases and built-ins, preface your command with a call to exec, e.g. exec service baseband restart.
In Companion, a similar utility called
arabesque was used to execute batch files. ARES Shell scripts are not generally compatible with Arabesque scripts.
Variable Substitution
exec allows variables to be substituted with $<varname>, where <varname> corresponds to a key in the env section of the database. $ can be escaped as \$ to prevent substitution, e.g. when defining aliases.
To create or modify a variable, use the set built-in. Note that the environment is global: any command run on your system shares the same pool of variables, with the exception of certain built-ins:
The following variable names are reserved and will always return special values regardless of how they are set in
env:
-
$name always returns the display name of the avatar that triggered exec.
-
$user always returns the UUID of the avatar that triggered exec.
-
$self always returns the UUID of the avatar that owns the system.
-
$me always returns id.callsign (the full name of the system).
Variable substitutions are only parsed within system command calls; they cannot be used in direct speech or aliases. To work around this, use say, e.g.
@say =alias lastmsg echo $msg - which will cache the current value of $msg.