shell input parameter

来源:互联网 发布:淘宝美工难吗 编辑:程序博客网 时间:2024/06/01 09:23
====================================================================================
$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"...
====================================================================================