最近需要写一些脚本,其中一个需求就是把命令执行的结果存到一个数组,在后面遍历循环使用它,不多说直接上代码: array=(`./qshell listbucket2 mereith-www | awk '{print $1}' `) len= ${#array[@]} i=0 while [ $i -lt $len ] do ./qshell delete mereith-www " ${arra…
最近需要写一些脚本,其中一个需求就是把命令执行的结果存到一个数组,在后面遍历循环使用它,不多说直接上代码: array=(`./qshell listbucket2 mereith-www | awk '{print $1}' `) len= ${#array[@]} i=0 while [ $i -lt $len ] do ./qshell delete mereith-www " ${arra…
讨论
登录后参与讨论
还没有评论,来说第一句吧。