我在这里关注一些教程,每当我执行这个,我得到
Do you want to create a bukkit server on this computer? (Hint: answer YES or NO) > no
answered no
./test.sh: line 44: syntax error near unexpected token `else'
./test.sh: line 44: 'else'
这是脚本:
while true; do
read -p "Do you want to create a bukkit server on this computer? (Hint: answer YES or NO) > " yn
case $yn in
[Yy]* ) echo answered yes; INSTALL="Y"; break;;
[Nn]* ) echo answered no; break;;
* ) echo "Please answer yes or no.";;
esac
done
if [ -z "$INSTALL" ];
echo "Yay!"
else
echo "Sadface!"
fi
我是 bash 新手:/