#!/bin/bash
e=`date +%s`
#隨機抽取一個1-9內的一個數字
#/dev/urandom 是一個庫函數
k=`cat /dev/urandom |tr -dc 1-9 |head -c 1`
f=$(($e+$k))
while :
do
a=({1..9} 10 )
for i in {0..9}
do
b=${a[$i]}
echo $b
sleep 0.1
#實現自動停止
w=`date +%s`
if [ $w -ge $f ];then
exit 0
fi
done
done