1: 2: 3: 4: 5: 6: 7: 8: 9:
some-command if [ $? -ne 0 ] then echo "command failed" exit 1 else echo "command succeeded" fi