Skip to content

Instantly share code, notes, and snippets.

@kocoai
Last active July 11, 2019 12:26
Show Gist options
  • Save kocoai/9dc2fadcb69192d1cd09a2018820648b to your computer and use it in GitHub Desktop.
Save kocoai/9dc2fadcb69192d1cd09a2018820648b to your computer and use it in GitHub Desktop.
Pass arguments into a shell function #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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment