Skip to content

Instantly share code, notes, and snippets.

@tasermonkey
Created February 25, 2015 17:59
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 tasermonkey/30e034432387d18ffae3 to your computer and use it in GitHub Desktop.
Save tasermonkey/30e034432387d18ffae3 to your computer and use it in GitHub Desktop.
shell-print-date-time-on-execute
preexec () {
DATE=`date +"%H:%M:%S on %Y-%m-%d"`
C=$(($COLUMNS-24))
echo -e "\033[1A\033[${C}C ${fg[red]}${DATE}${reset_color}"
}
@tasermonkey
Copy link
Author

I use this so that I know when I started executing a program.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment