Skip to content

Instantly share code, notes, and snippets.

@eidantoei
Created May 31, 2012 07:44
Show Gist options
  • Save eidantoei/2841714 to your computer and use it in GitHub Desktop.
Save eidantoei/2841714 to your computer and use it in GitHub Desktop.
tailf+awk: Add timestamp
Shell 1
=======
# ./logger.sh
Shell 2
=======
# tailf log | awk -f add_timestamp.awk
{
print strftime("%F-%T"),$0;
}
#!/bin/bash
while :; do
echo "${RANDOM}" | tee -a ./log
sleep 0.8
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment