Created
October 4, 2017 17:18
-
-
Save caljess599/feea1d303dfaf4030be0f2f10c6df306 to your computer and use it in GitHub Desktop.
shell script to timestamp input piped to it, if output is not empty
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/bash | |
while read x; do | |
if [ -n "$x" ]; then | |
echo -n `date +%Y-%m-%dT%H:%M:%S` | |
echo -n " " | |
echo $x | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment