Skip to content

Instantly share code, notes, and snippets.

@fangpsh
Created November 2, 2015 04:37
Show Gist options
  • Save fangpsh/3f481d51bac18ed012a9 to your computer and use it in GitHub Desktop.
Save fangpsh/3f481d51bac18ed012a9 to your computer and use it in GitHub Desktop.
#!/bin/sh
# command | bash time-stramp.sh
if [ $# -gt 0 ];then
exec 0<$1;
fi
while read line
do
echo `date "+%Y-%m-%d %H:%M:%S"` $line;
done<&0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment