[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] line timestamp command
- Subject: [ale] line timestamp command
- From: splante at insightsys.com (Scott Plante)
- Date: Tue, 12 Nov 2013 13:34:22 -0500 (EST)
- In-reply-to: <[email protected]>
Does anyone happen to know of a command line tool that will read lines from standard input and write them to std out, pre-pending a timestamp? I have a process that emits messages to std out periodically as it processes and I'd like to write that to a log file, but with a time at the start of the line. I could do it with a script but a nice little command would be better, if it exists.
I'm looking for something that would perform the function of this script, maybe with an option for format:
while read line;
do
echo $(date +"%D %T") "$line";
done
Scott
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ale.org/pipermail/ale/attachments/20131112/e6dfee33/attachment.html>