shell 循环语句while的使用

来源:互联网 发布:魔兽争霸3mac原生版 编辑:程序博客网 时间:2024/06/05 18:45

while 的使用:

#!/bin/bash
array=(chending chenhua chenhong);
echo "the member of chen"
len=${#array[*]}
index=0
while [ $index -lt $len ];do
    echo "the name is ${array[$index]}"
let index++
done

原创粉丝点击