Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Sep 2006 09:01:54 +0300
From:      Giorgos Keramidas <keramida@freebsd.org>
To:        Julian Elischer <julian@elischer.org>
Cc:        Peter Jeremy <peterjeremy@optushome.com.au>, freebsd-current@freebsd.org, Lucas James <Lucas.James@ldjcs.com.au>
Subject:   Re: suggested addition to 'date'
Message-ID:  <20060905060154.GA84448@gothmog.pc>
In-Reply-To: <44FA7720.5040304@elischer.org>
References:  <200608281545.k7SFjn6l063922@lurza.secnetix.de> <p06230928c11e2298ca97@[128.113.24.47]> <200609020956.54008.Lucas.James@ldjcs.com.au> <20060902031247.GE749@turion.vk2pj.dyndns.org> <44FA7720.5040304@elischer.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2006-09-02 23:33, Julian Elischer <julian@elischer.org> wrote:
>Peter Jeremy wrote:
>>
>> Firstly, we already have this:
>> 	sed "s=^=$(date)=" file
>>
>> And secondly, this pre-pends a fixed string.  What's wanted is a filter
>> to prepend a time/date stamp (which varies) to the input stream.
>>
>> The justification for extending date(1) is that it already has the code
>> to handle date/time stamps.  In reality, this code is all in strftime(3)
>> and cat(1) already has hooks to insert a string at the beginning of a
>> line so I believe that the attached patch is more appropriate.  (Man
>> page update on request).
>
> I look forward to this commit..
> (I don't care where I get the capacity from as long as I can datestamp
> files)
>
> puting it in 'tee' is also an option.. timestamping the 'file' output.

Which is pointless and shows why this bikeshed is never going to be
purple.  Why do we have to bloat tee(1) with something that makes the
'file' output different from the screen output (effectively making both
of them useless, as it breaks the very-nature of tee(1))?  The same
effect, without *any* sort of functionality loss, can be obtained with:

    # command 2>&1 | tslog | tee logfile

where 'tslog' is a proper 'timestamping' filter.

What are we going to modify next, cc(1) to output timestamped error and
warning messages?

The more this thread goes on, the more my opinion tends to be that this
belongs to a standalone filter, examples of which a lot of people have
posted already :(




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060905060154.GA84448>