摘要: [root@hadoop01 test-shell]# cat test-array.sh #! /bin/bash #定义数组 array=() #新增元素 array+=(1) array+=(2) #读取数组 echo ${array[0]} echo ${array[*]} echo ${array[@]} #获得数组长度 echo ${#array[*]} [root@... 阅读全文
posted @ 2016-09-23 19:03 God_Mode 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 左移参数,即$3变为$2,$2变为$1。 示例: 运行结果: 当输入参数比较多的时候可以采用shift.另外,也可以利用 shift N ,左移N个位置。N>0 阅读全文
posted @ 2016-09-23 14:25 God_Mode 阅读(184) 评论(0) 推荐(0) 编辑