shell: demo

前端之家收集整理的这篇文章主要介绍了shell: demo前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
#!/bin/bash


eat[1]="泡面"
eat[2]="粑粑"
eat[3]="烩面"
eat[4]="热干面"
eat[5]="鸡蛋面"
eat[6]="刀削面"
eat[7]="肉丝面"

index=0
while [ "${index}" -lt 3 ]; do
    check=$(( ${RANDOM} * ${index} / 32767 + 1 ))
    mycheck=0
    if [ "${index}" -ge 1 ]; then
        for i in $(seq 1 ${index})
        do
            if [ $[indexcon[${i}]] == ${chek} ]; then
                mycheck=1
            fi
        done
    fi
done

猜你在找的Bash相关文章