$@:表示所有脚本参数的内容
$#:表示返回所有脚本参数的个数。
示例:编写如下shell脚本,保存为test.sh:
#!/bin/sh
echo "number:$#"
echo "argume:$@"
执行脚本:
./test.sh first_arg second_arg

说明:给脚本提供了两个参数,所以$#输出的结果是2,$@代表了参数的内容!
本文永久更新地址://m.ajphoenix.com/linux/22016.html