[root@Greendays lianshou]# cat test.sh
#!/bin/bash
echo $#
echo $@
shift
echo $#
echo $@
shift
echo $#
echo $@
shift
echo $#
echo $@
[root@Greendays lianshou]# ./test.sh 1 2 3 4
4
1 2 3 4
3
2 3 4
2
3 4
1
4
[root@Greendays lianshou]# ./test.sh 1 2 3 4 5 6 7 8 9
9
1 2 3 4 5 6 7 8 9
8
2 3 4 5 6 7 8 9
7
3 4 5 6 7 8 9
6
4 5 6 7 8 9
[root@Greendays lianshou]# cat test.sh
#!/bin/bash
echo $#
echo $@
shift
echo $#
echo $@
shift
echo $#
echo $@
shift
echo $#
echo $@
阅读(571) | 评论(0) | 转发(0) |