Skip to content

Instantly share code, notes, and snippets.

@stormslowly
Last active August 29, 2015 14:20
Show Gist options
  • Save stormslowly/d258ee1d3491f2da9183 to your computer and use it in GitHub Desktop.
Save stormslowly/d258ee1d3491f2da9183 to your computer and use it in GitHub Desktop.
add prefix time stamp for console output
someCMD | awk 'BEGIN{cmd="date +%H:%M:%S.%N"} {cmd|getline D; close(cmd); print D,$0}'
"this way slow down the cmd execute try below
someCMD | awk '{print strftime("%H:%M:%S"),$0}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment