exec
ARES System Manual: exec Shell

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 attempts to run a command that starts with @, 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.

In this manual, whenever a command syntax definition begins with '(input) @...', it is a call to the default system shell implemented by exec.

The system shell may be changed by modifying the database value input.shell and restarting input.

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.

In Companion, exec's closest equivalent was called arabesque. However, 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 commands.

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 input.
- $user always returns the UUID of the avatar that triggered input.
- $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.