Skip to content

Instantly share code, notes, and snippets.

@hkolbeck
Created December 31, 2013 01:11
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 hkolbeck/8190867 to your computer and use it in GitHub Desktop.
Save hkolbeck/8190867 to your computer and use it in GitHub Desktop.
declare -A ignoredCommands
ignoredCommands=( 'ls' 1 'cd' 1 'echo' 1 'rmdir' 1 'mkdir' 1 'touch' 1 'man' 1 'ln' 1 'pwd' 1 )
function pre_exec {
COMMAND=$(cut -f1 -d' ' <(echo $1) )
if [ ! "${ignoredCommands[$COMMAND]}" ]; then
date
fi
}
add-zsh-hook preexec pre_exec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment