I would like to know what -eq does in a bash script (as in the below example):
LINES=`ps -p $PID`
PIDRET=$?
if [ $PIDRET -eq 0 ];
then
export PID
return 0;
fi
rm -f "$CATALINA_PID"
I would like to know what -eq does in a bash script (as in the below example):
LINES=`ps -p $PID`
PIDRET=$?
if [ $PIDRET -eq 0 ];
then
export PID
return 0;
fi
rm -f "$CATALINA_PID"
-eq in bash means exactly the same as == - it perfroms logical comparison of two things checking if they're equal. You can find more about operators in bash in documentation: http://www.tldp.org/LDP/abs/html/comparison-ops.html