${!args[@]}为数组索引从0开始
[nat@system1 ~]$ sh testargs1.sh 1 2 3
31 2 3
[nat@system1 ~]$ cat testargs1.sh
#!/bin/bash
O=($@)
echo ${O[2]}
echo $@
[nat@system1 ~]$
[root@centos5 ~]# ./testtw.sh 1 2 3
11 2 3
[root@centos5 ~]# cat testtw.sh
#!/bin/bash
O=($@)
echo $O
echo $@
[root@centos5 ~]#
[root@centos5 ~]# vi testtw.sh
[root@centos5 ~]# ./testtw.sh 1 2 3
1 2 3
1 2 3
[root@centos5 ~]