Skip to content

Instantly share code, notes, and snippets.

@YumaInaura
Last active September 1, 2018 13:36
Show Gist options
  • Save YumaInaura/4cf87fc9ad53576f88e690b107506127 to your computer and use it in GitHub Desktop.
Save YumaInaura/4cf87fc9ad53576f88e690b107506127 to your computer and use it in GitHub Desktop.
Bash — $# Dollar and sharp means arguments num

Bash — $# Dollar and sharp means arguments num

Example

bash -c 'echo $#' -a arg1 arg2 arg3 arg4 arg5
5
bash -c 'echo $#'
0
bash -c 'echo $#' -a "arg1 arg2 arg3 arg4 arg5"
1

Versions

  • bash 4.4

Links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment