variable

BASH_ARGV

Array of arguments from active shell frames, stored in reverse order, when extended debugging is enabled. Enable extdebug before entering the inspected function. Values may contain secrets; never dump the array indiscriminately. Run in a fresh private directory with HOME set to that directory and LC_ALL=C. Expected output (one item per line): [two words]; [first].

Formal Syntax & Structure

bash syntaxbash
BASH_ARGV

Return Value

indexed array

Expansion yields the current value; it has no independent command exit status.

Working Example

Example Snippetbash
shopt -s extdebuginspect() { printf '[%s]\n' "${BASH_ARGV[0]}" "${BASH_ARGV[1]}"; }inspect first 'two words'
Bash Reference