test.sh
#! /bin/sh
echo 'success' $1
执行 ./test.sh start
,输出的结果就是 success start。如此,start 就作为参数传递进脚本了
test.sh
#! /bin/sh
echo 'success' $2
./test.sh 1
的输出结果仍为 success,但如果 ./test.sh 1 2
,输出结果为 success 2
test.sh
#! /bin/sh
echo 'success' $1
执行 ./test.sh start
,输出的结果就是 success start。如此,start 就作为参数传递进脚本了
test.sh
#! /bin/sh
echo 'success' $2
./test.sh 1
的输出结果仍为 success,但如果 ./test.sh 1 2
,输出结果为 success 2