shell-code-2-传参

#在执行shell脚本时,带参数,如./test.sh 1 2 3,则在脚本test.sh内,参数表示为$n的形式,$1为第一个参数,以此类推。

echo "第一个参数为:$1";

echo "参数个数为:$#";

echo "传递的参数作为一个字符串显示:$*";

原文地址:https://www.cnblogs.com/pxy7896/p/6417442.html