If block always goes to else in Bash
问题 The following segment of code goes to the else statement when it should be going into the elif . #The following line returns 3, 4 or 5 as the exit code. $BASH_EXEC adbE.sh "adb $ARGUMENT install $f" echo "the return code:$?." if [ $? -eq 5 ] then #do nothing, success continue elif [ $? -eq 4 ] then echo "WARNING" else echo "ERROR" break fi This part: echo "the return code:$?." echoes this to the screen: the return code:4. And it does not display WARNING . It only displays ERROR and then