Skip to content

Instantly share code, notes, and snippets.

@erochest
Created September 5, 2012 13:59
Show Gist options
  • Save erochest/3637000 to your computer and use it in GitHub Desktop.
Save erochest/3637000 to your computer and use it in GitHub Desktop.
Combined exit codes
#!/bin/bash
./sub_exit.bash
ec1=$?
./sub_exit.bash
ec2=$?
[[ "$ec1" -eq "0" && "$ec2" -eq "0" ]]
#!/bin/bash
if [ "x$1" == "x" ]
then
echo "success"
exit 0
else
echo "epic fail"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment