The exit status of the entire construct is:
- the exit status of the last command executed,
- or zero if no condition tested true.
if [ "foo" = "foo" ]; then echo expression evaluated as true else echo expression evaluated as false fi
Documentation / Reference