[ale] line timestamp command

Ed Cashin ecashin at noserose.net
Tue Nov 12 14:58:03 EST 2013


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.

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.

http://cr.yp.to/daemontools/tai64n.html
http://cr.yp.to/daemontools/tai64nlocal.html



On Tue, Nov 12, 2013 at 1:34 PM, Scott Plante <splante at insightsys.com>wrote:

> 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
>
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
>
>


-- 
  Ed Cashin <ecashin at noserose.net>
  http://noserose.net/e/
  http://www.coraid.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ale.org/pipermail/ale/attachments/20131112/9c3e30c1/attachment.html>


More information about the Ale mailing list