====================================================================================
$1...$n express first parameter...n parameter
$# express parameter count
eval echo \$$#
shift 'expr $# - $i'
====================================================================================
The following two writing are the same:
for arg in $*
for arg in $@
The following two writing are different:
for arg in $*
for arg in "$@"
Note:
$*: transfer 'a b' c to a b c
$*: Replace command parameters to $1, $2...
$@: Replace command parameters to "$1", "$2"...
====================================================================================
$1...$n express first parameter...n parameter
$# express parameter count
eval echo \$$#
shift 'expr $# - $i'
====================================================================================
The following two writing are the same:
for arg in $*
for arg in $@
The following two writing are different:
for arg in $*
for arg in "$@"
Note:
$*: transfer 'a b' c to a b c
$*: Replace command parameters to $1, $2...
$@: Replace command parameters to "$1", "$2"...
====================================================================================