Skip to content

Instantly share code, notes, and snippets.

@jneen
Created January 18, 2011 19:04
Show Gist options
  • Save jneen/784944 to your computer and use it in GitHub Desktop.
Save jneen/784944 to your computer and use it in GitHub Desktop.
# ~/.bashrc
trap on_exit EXIT
on_exit() {
mail -s "Bash: logging out at $(date)" monitor@example.com < (
echo "Commands run:"
history
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment