if statement options in bash script
I have a bash script (not mine) that is generating some errors. I'm trying to fix that but there is a section that I do not understand.
Code:
snpsOALib=`OA_MODE=opt $OA_ROOT/bin/oaGetLibPath` I don't know what $? is .. I thought it's a variable but that is the only one written in the file(it is not defined before,neither $? nor ?). now what does this If statement mean ?? can somebody explain ?? |
$? is the exit code of the last command
when exit code is 0 it means no error, and none-zero code is an Error try it with a few things true;echo $? false;echo $? ffaallssee;echo $? so what is happening which with the script is Code:
snpsOALib=`OA_MODE=opt $OA_ROOT/bin/oaGetLibPath` |
Open Audit?
err. n/m |
Incidentally, '!=' is the wrong operator for a numeric comparison; it should be '-ne', or use (( )) instead of [[ ]] http://tldp.org/LDP/abs/html/comparison-ops.html:
|
All times are GMT -5. The time now is 10:16 AM. |