Saya mendapatkan kesalahan berdasarkan "lalu". haruskah saya memberi ruang sebelum itu?
winning=$(( RANDOM % 15 ))
while [[${guess}-ne ${winning}]]; then
read -p "guess a number from 0 to 15: " guess
if [[${guess}-ne ${winning}]]; then
echo "Your guess, ${guess}, was incorrect. Guess again to win a \$200 Guess handbag."
fi
done
echo "Congrats! You got it! ${guess}"
exit 0
3
tidak. lihat dokumentasi pada struktur While loop di bash / shell. cyberciti.biz/faq/bash-while-loop
—
Frank Thomas