Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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