bar

#/bin/bash
PATH=${PATH}:~/bin
export PATH

预览
eat[1]="卖当当漢堡包"       # 写下你所收集到的店家!
eat[2]="肯爷爷炸鸡"
eat[3]="彩虹日式便当"
eat[4]="越油越好吃大雅"
eat[5]="想不出吃啥学餐"
eat[6]="太师父便当"
eat[7]="池上便当"
eat[8]="怀念火车便当"
eat[9]="一起吃方便面"

index=0
while [ 1 ]
do

check=$((${RANDOM}*9/32767 +1))

if [ ${#picked[@]} ==  0 ]; then
picked[${index}]=${check}
continue
fi

for ((i=0;i<${#picked[@]};i++))
do
   if [ ${check} == ${picked[${i}]} ]; then
      continue 2
   fi
done

((index++))
picked[${index}]=${check}

if [ ${index} == 2  ]; then
break
fi

done

for pick in $(echo ${picked[*]})
do
echo ${eat[${pick}]}
done

 

发表评论

电子邮件地址不会被公开。 必填项已用*标注