variable

Bash BASH — shell executable pathname

Identifies the pathname Bash uses for the current shell. It is useful for invoking a child Bash in controlled environments; it is not a security proof of the executable identity. Run in a fresh private directory with HOME set to that directory and LC_ALL=C. Expected output (one item per line): child bash.

Formal Syntax & Structure

bash syntaxbash
${BASH}

Return Value

string

Current value of the variable; expansion does not independently return an exit status.

Working Example

Example Snippetbash
[[ -x $BASH ]] || exit 1"$BASH" --noprofile --norc -c 'printf "child bash\n"'
Bash Reference