if / else path在上一个命令的返回值上不如预期的那样

时间:2015-11-24 18:16:55

标签: bash if-statement

       sh $CPB_BIN/nm187_sort.sh $CPB_TRANS/$SORT_FILE_ORIGINAL $CPB_TRANS/$OUTPUT_FILE

       if [ $? == -1 ]
       then
          print "Nonmon sort command failed: $!\n"
                      exit 1
       else
          print "Nonmon sort command exited with value $?\n"

由于某种原因,如果排序脚本失败,它仍然采用其他部分。我错过了什么?

0 个答案:

没有答案