Last active
December 21, 2015 01:39
-
-
Save vsaw/6229181 to your computer and use it in GitHub Desktop.
Adds a timestamp to console output.To use just type: `cat /dev/ttyUSBn | timestamp.sh`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# If Millisecond precision is required for the output uncomment the following | |
# line | |
# | |
# awk '{ system("date +%T.%N"); print strftime("%Y-%m-%dT%H:%M:%S"), $0; fflush(); }' | |
# Regular second precision timestamps | |
awk '{ print strftime("%Y-%m-%dT%H:%M:%S"), $0; fflush(); }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment