Bourne: if statement testing exit status

Posted by sixtyfootersdude on Stack Overflow See other posts from Stack Overflow or by sixtyfootersdude
Published on 2010-04-23T14:16:23Z Indexed on 2010/04/23 14:23 UTC
Read the original article Hit count: 313

Filed under:
|
|
|

What is the difference:

if IsServerStarted ; then ...

and

if [ IsServerStarted -eq 0 ] ; then ...

Seems to me that these two statements should be equivalent? Strangely the second statement is always true.

© Stack Overflow or respective owner

Related posts about bourne

Related posts about shellscript