Skip to content

Instantly share code, notes, and snippets.

@kowey
Created January 10, 2011 11:17
Show Gist options
  • Select an option

  • Save kowey/772656 to your computer and use it in GitHub Desktop.

Select an option

Save kowey/772656 to your computer and use it in GitHub Desktop.
notify-long
#!/bin/bash
CMD=$@
$CMD
STATUS=$?
CMD_SUMMARY=`echo $CMD`
HOSTNAME=`hostname --short`
NOTIFY=notify-send
if [ $STATUS == 0 ]; then
$NOTIFY "DONE: $CMD_SUMMARY ($HOSTNAME)"
else
$NOTIFY "ERROR ($STATUS): $CMD_SUMMARY ($HOSTNAME)"
fi
exit $STATUS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment