variable
SHELLOPTS
Readonly colon-separated list of enabled set -o options. When exported, a normal child Bash can enable them at startup; privileged invocation ignores this environmental input.
Formal Syntax & Structure
bash syntaxbash
$SHELLOPTSReturn Value
option list
Readonly colon-separated list of enabled set -o options. When exported, a normal child Bash can enable them at startup; privileged invocation ignores this environmental input.
Working Example
Example Snippetbash
set -o pipefailshopt -s nullglobexport SHELLOPTS BASHOPTSbash -c '[[ -o pipefail ]] && printf "pipefail=on\n"; shopt -q nullglob && printf "nullglob=on\n"'