variable
Bash BASH_ARGV0 — shell name alias
Reading BASH_ARGV0 yields the value of $0; assigning to it changes $0. Useful for understanding invocation identity, not for authenticating the caller. It is supported on the tested Bash 5.2 baseline. Run in a fresh private directory with HOME set to that directory and LC_ALL=C. Expected output (one item per line): zero=demo; alias=demo.
Formal Syntax & Structure
bash syntaxbash
${BASH_ARGV0}Return Value
string
Current value of the variable; expansion does not independently return an exit status.
Working Example
Example Snippetbash
BASH_ARGV0=demoprintf 'zero=%s\n' "$0"printf 'alias=%s\n' "$BASH_ARGV0"