<div dir="ltr">I do happen to know of one, but it's by Dan J. Bernstein. That sometimes means it's of uncommonly high quality and careful design but low user convenience.<div><br></div><div>Usually the resolution is to do everything the way DJB thinks things should be done. Then it's convenient and reliable. But it requires the user to adjust behavior and/or expectations. In this case, tai64n does what you ask for, but the timestamp is not probably anything you'd want to read. So tai64nlocal converts it. Weird, but not carelessly designed.</div>
<div><br></div><div><a href="http://cr.yp.to/daemontools/tai64n.html">http://cr.yp.to/daemontools/tai64n.html</a><br></div><div><a href="http://cr.yp.to/daemontools/tai64nlocal.html">http://cr.yp.to/daemontools/tai64nlocal.html</a><br>
</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Nov 12, 2013 at 1:34 PM, Scott Plante <span dir="ltr"><<a href="mailto:splante@insightsys.com" target="_blank">splante@insightsys.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-size:12pt;font-family:arial,helvetica,sans-serif"><font face="arial, helvetica, sans-serif" size="3">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. </font><div style="font-size:12pt;font-family:arial,helvetica,sans-serif">
<br></div><div style="font-size:12pt;font-family:arial,helvetica,sans-serif">I'm looking for something that would perform the function of this script, maybe with an option for format:</div><div><font face="arial, helvetica, sans-serif"><br>
</font></div><div><font face="courier new, courier, monaco, monospace, sans-serif">while read line; </font></div><div><font face="courier new, courier, monaco, monospace, sans-serif">do </font></div><div><font face="courier new, courier, monaco, monospace, sans-serif"> echo $(date +"%D %T") "$line"; </font></div>
<div><font face="courier new, courier, monaco, monospace, sans-serif">done<span class="HOEnZb"><font color="#888888"><br></font></span></font><span class="HOEnZb"><font color="#888888"><div style="font-size:12pt;font-family:arial,helvetica,sans-serif">
<br></div><div style="font-size:12pt;font-family:arial,helvetica,sans-serif">Scott</div><br></font></span></div></div></div><br>_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br> Ed Cashin <<a href="mailto:ecashin@noserose.net">ecashin@noserose.net</a>><br> <a href="http://noserose.net/e/">http://noserose.net/e/</a><br> <a href="http://www.coraid.com/">http://www.coraid.com/</a>
</div>