Advertisement
Guest User

Untitled

a guest
Dec 18th, 2014
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. check_exit_status() {
  2. # Checks the latest exit status and exits if status is non-zero
  3. # usage: check_exit_status $? "my_function"
  4. EXITSTAT=$1
  5. FUNC=$2
  6. if [ "$EXITSTAT" -ne "0" ]; then
  7. echo "$FUNC failed" | tee $LOG
  8. exit $EXITSTAT
  9. fi
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement