Re: date enhancement - filter to preface each line of input with timesta
From:
Pádraig Brady
Subject:
Re: date enhancement - filter to preface each line of input with timestamp
Date:
Mon, 2 Nov 2015 10:25:00 +0000
User-agent:
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0
On 01/11/15 22:57, Evan Rempel wrote:
> There is a lot of discussion on the net about prefacing a timestamp to
> every line of a text stream. There are solutions with awk, perl, python
> and bash. coreutils even provides one using perl. This seems to be a
> very heavy tool to do something that date already does all of the hard
> work for.
>
> Does it make sense to add an option -p --prefix to make date prefix
> every line of stdin with a date/time stamp?
It's useful functionality, though already available using other tools.
http://stackoverflow.com/q/21564/4421
The general rule we use is to not couple logic
unless it provides a functional benefit to do so.
Personally I like the awk solution presented above.
cheers,
Pádraig.