我一直在到处寻找一个解释。下面是一个取自apt-fast.sh .sh脚本的真实示例:
if [ ! -x /usr/bin/axel ]
then echo "axel is not installed, perform this?(y/n)"
read ops
case $ops in
y) if apt-get install axel -y --force-yes
then echo "axel installed"
else echo "unable to install the axel. you are using sudo?" ; exit
fi ;;
n) echo "not possible usage apt-fast" ; exit ;;
esac
fi在if代码块中间使用"fi ;;"有什么用?
发布于 2011-08-10 20:36:35
fi关闭if语句,而;;关闭case语句中的当前条目。
发布于 2011-08-10 20:35:51
fi用于关闭y) case语句中的if块,;;用于结束y) case。
发布于 2011-08-10 20:35:00
fi终止前面的if,而;;终止case...esac中的y)情况。
https://stackoverflow.com/questions/7010830
复制相似问题