Re: suggested addition to 'date'

From: Peter Jeremy <peterjeremy_at_optushome.com.au>
Date: Sat, 2 Sep 2006 13:12:48 +1000
On Sat, 2006-Sep-02 09:56:53 +1000, Lucas James wrote:
>On Saturday 02 September 2006 03:53, Garance A Drosehn wrote:>
>> mode.  Not ever.  Date is a command to set or display dates.
>> It is not a command to filter files.  'cat' would be a more
> appropriate place to add this option.

I tend to agree.

>or add an option to cat to prepend each line with an arbitrary string ala:
>
>cat -p `date` file

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).

-- 
Peter Jeremy

Received on Sat Sep 02 2006 - 01:12:53 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:59 UTC