Number of Positional Parameters

$# is the number of available positional parameters $1, $2, etc.

Examples

Print number of positional parameters :

1
2
set a b c 
echo "$#"

Output: 3.

BashSupport Pro is a Bash IDE with support for $# – try it now!
© 2020–2022 Joachim Ansorg
Imprint
Privacy Policy
Legal