📅  最后修改于: 2022-03-11 14:49:31.110000             🧑  作者: Mango
# in r.sh
echo "params only 2 : ${@:2:1}"
echo "params 2 and 3 : ${@:2:2}"
echo "params all from 2: ${@:2:99}"
echo "params all from 2: ${@:2}"
# run it:
$ chmod u+x r.sh
$ ./r.sh 1 2 3 4 5 6 7 8 9 10
# result:
params only 2 : 2
params 2 and 3 : 2 3
params all from 2: 2 3 4 5 6 7 8 9 10
params all from 2: 2 3 4 5 6 7 8 9 10