我是小白到shell腳本,我想知道這一點:循環if語句
#!/usr/local/bin/bash
number=5
echo "Enter 'yes' to continue, 'no' to abort:"
read choice
if [ $choice = yes ]; then
while [ $number -lt 10 ]; do
echo "The script is now looping!"
done
elif [ $choice = no ]; then
echo "Loop aborted"
else
echo "Please say 'yes' or 'no'"
read choice
# What now?
fi
我怎麼會去的if語句重新檢查$選擇(第13行),如果你不要指定「是」或「否」?
謝謝。
得到它的工作。謝謝! :) – Jordanss10