variable

Bash BASH_EXECUTION_STRING — command string supplied to -c

Contains the command text provided to Bash through -c when applicable. It may include sensitive data, so avoid logging it in production. This synthetic child checks equality instead of echoing arbitrary source. Run in a fresh private directory with HOME set to that directory and LC_ALL=C. Expected output (one item per line): present.

Formal Syntax & Structure

bash syntaxbash
${BASH_EXECUTION_STRING}

Return Value

string

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

Working Example

Example Snippetbash
bash --noprofile --norc -c '[[ $BASH_EXECUTION_STRING == *marker* ]] && printf "present\n" # marker'
Bash Reference