Skip to content

Instantly share code, notes, and snippets.

@atheiman
Created November 3, 2017 20:12
Show Gist options
  • Save atheiman/14b94724c7d02c7ac8e953efa462e2d2 to your computer and use it in GitHub Desktop.
Save atheiman/14b94724c7d02c7ac8e953efa462e2d2 to your computer and use it in GitHub Desktop.
echo_and_run simple shell function to print timestamp and command then execute the command (useful in build tools that dont log well)
$ echo_and_run() { echo "$(date +%T) $*"; $*; }
$ echo_and_run ls
# 15:09:35 ls
# Gemfile Gemfile.lock README.md spec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment