0
我正在研究一个bash脚本,并且由于某种原因,if语句总是成真。如果我运行下面的应用程序,并在提示我键入yes并回车,这里是打印出来:Bash脚本比较不起作用
The code will be checked out in the location the file is in, is this ok? (yes or no)
yes
yes
Stopping app
这里是我的代码如下所示。我在这里错过了什么吗?
echo "The code will be checked out in the location the file is in, is this ok? (yes or no)"
read answer
echo $answer
if [[ $answer -eq "no" ]] ; then
echo "Stopping app"
exit 1
fi