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