kocoai
4/29/2017 - 11:17 AM

Pass arguments into a shell function #tags:shell

Pass arguments into a shell function #tags:shell

https://bash.cyberciti.biz/guide/Pass_arguments_into_a_function

  • All function parameters or arguments can be accessed via $1, $2, $3,..., $N.
  • $0 always point to the shell script name.
  • $* or $@ holds all parameters or arguments passed to the function.
  • $# holds the number of positional parameters passed to the function.