Skip to content

Instantly share code, notes, and snippets.

@xiangzhuyuan
Last active March 24, 2020 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xiangzhuyuan/b0bc6136c293d0b76775eac708b9ef78 to your computer and use it in GitHub Desktop.
Save xiangzhuyuan/b0bc6136c293d0b76775eac708b9ef78 to your computer and use it in GitHub Desktop.
the list of bash default var
#!/bin/bash
#
printf "The complete list is %s\n" "$$"
printf "The complete list is %s\n" "$!"
printf "The complete list is %s\n" "$?"
printf "The complete list is %s\n" "$*"
printf "The complete list is %s\n" "$@"
printf "The complete list is %s\n" "$#"
printf "The complete list is %s\n" "$0"
printf "The complete list is %s\n" "$1"
printf "The complete list is %s\n" "$2
$ bash params.sh 123456 QQ
The complete list is 24249
The complete list is
The complete list is 0
The complete list is 123456 QQ
The complete list is 123456
The complete list is QQ
The complete list is 2
The complete list is params.sh
The complete list is 123456
The complete list is QQ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment