我是shell脚本的菜鸟,我想知道这个:
#!/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 语句重新检查您的 $choice(第 13 行)?
谢谢你。