What does $# mean in bash?

Danh Trịnh

New member
What does $# mean in bash?
Answer
$# is
the number of positional parameters passed to the script, shell, or shell function. This is because, while a shell function is running, the positional parameters are temporarily replaced with the arguments to the function. This lets functions accept and use their own positional parameters.
 

Tìm kiếm

Back
Top