标签:bin ++ else lse int enter ber rand exit
#!/bin/bash
PRICE=$(expr $RANDOM % 1000)
TIMES=0
while true
do
read -p "Enter number:" INT
let TIMES++
if [ $INT -eq $PRICE ]
then
echo "right"
echo "Times is $TIMES"
exit 0
elif [ $INT -gt $PRICE ]
then
echo "HIGH"
else
echo "Low"
fi
done
标签:bin ++ else lse int enter ber rand exit
原文地址:https://blog.51cto.com/sampsondotqiu/2490644