这是脚本,我不断收到意外的 fi 错误。我错过了什么?..(我开始将 [] 用于 if 语句,但由于我使用此命令,我删除了 [] .. 这样可以吗?)
if type "java" 2>&1;
then
echo "All ok . . . ";
exit
else
read -n1 -r -p "Yo need to install"
while true; do
echo "Want to install??"
select yn in "y" "n"; do
case $yn in
y ) echo "Installing here..."; break;;
n ) echo "Ok... stopping..."; exit;;
esac
done
exit
fi
谢谢!