我是小白到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