Skip to content

Instantly share code, notes, and snippets.

@mikebell
Created December 7, 2015 00:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikebell/0aa633b23d160293c0c1 to your computer and use it in GitHub Desktop.
Save mikebell/0aa633b23d160293c0c1 to your computer and use it in GitHub Desktop.
trap 'error=1' ERR
while true; do
slackin "ACCOUNTNAMEHERE" "KEYGOESHERE" -p 8002 -s
code="$?"
if [[ -n "$error" ]]; then
echo "Caught an error! Status = $code"
error= # reset the error
elif [[ "$code" != 0 ]]; then
echo "Program exited with non-zero code: $code"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment