bash笔记

2017-06-29  本文已影响0人  geofer
$ A=(this is an example of shell script)
$ echo ${A[0]} ${A[2]} ${A[3]} ${A[6]}
this an example script
$ echo ${A[8]}
$ echo ${A[*]}
this is an example of shell script
$ echo ${#A[*]}
7

推荐:

array=(
v1
v2
v3
)
for item in ${array[@]};  # ${}里面不能有空格
 do 
   # bulabula
 done
上一篇下一篇

猜你喜欢

热点阅读