Skip to main content

Module scripting

Module scripting 

Source
Expand description

Minimal shell scripting: variable expansion, if, for, while.

§Supported constructs

  • Variables: set VAR=VALUE, $VAR expansion, $? for last exit code.
  • For loops: for VAR in A B C ; do COMMAND ; done
  • While loops: while COMMAND ; do BODY ; done
  • If/then: if COMMAND ; then BODY ; fi or if COMMAND ; then A ; else B ; fi

Enums§

ScriptConstruct
Script construct types recognized by the parser.

Functions§

expand_vars
Expand $VAR and $? references in a string.
get_var
Get a shell variable.
last_exit
Get the exit code of the last executed command.
parse_script
Parse a full line into a script construct.
set_last_exit
Set the exit code of the last executed command.
set_var
Set a shell variable.
unset_var
Remove a shell variable.