variable

BASH_ARGC

Array of argument counts for active shell frames when extended debugging is enabled. Enable extdebug before entering functions whose arguments are inspected. The innermost active frame is first. Enabling extdebug may affect trap behavior; avoid changing production settings merely to collect diagnostics. Run in a fresh private directory with HOME set to that directory and LC_ALL=C. Expected output (one item per line): inner=2 outer=1.

Formal Syntax & Structure

bash syntaxbash
BASH_ARGC

Return Value

indexed array

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

Working Example

Example Snippetbash
shopt -s extdebuginspect() { printf 'inner=%s outer=%s\n' "${BASH_ARGC[0]}" "${BASH_ARGC[1]}"; }outer() { inspect one two; }outer three
Bash Reference