Set or unset shell options and positional parameters.

Synopsis

set [OPTION] [ARG]...

Description

With options, set or unset shell attributes. Without options, display all shell variables. With arguments, set positional parameters. Runs in the just-bash WASM shell inside SLICC.

Options

-e Exit immediately if a command exits with a non-zero status.

-u Treat unset variables as an error.

-x Print commands and their arguments as they are executed.

-o OPTION Set option by name (e.g., pipefail, errexit).

+e, +u, +x Unset the corresponding option.

Examples

$ set -e

Exit on first error.

$ set -x

Enable command tracing.

$ set -- arg1 arg2 arg3

Set positional parameters.

See Also

unset, export, env