Re: suggested addition to 'date'

From: Oliver Fromme <olli_at_lurza.secnetix.de>
Date: Mon, 4 Sep 2006 12:41:43 +0200 (CEST)
I'm sorry for the late reply.  I usually don't touch any
computer on weekends.

Garance A Drosehn wrote:
 > Oliver Fromme wrote:
 > > John Baldwin wrote:
 > > > Oliver Fromme wrote:
 > > > > There's another possibility, which doesn't require a new
 > > > > option letter at all.  You could add a new escape sequence
 > > > > to the format string, e.g. "%*".  Whenever date(1) is
 > > > > called with a format string containing that sequence, it
 > > > > goes into filter mode and replaces the sequence with the
 > > > > current line.
 > 
 > Note that the main objection to this option (at least from my
 > point of view) is that date should not be going into filter
 > mode.  Not ever.  Date is a command to set or display dates.

It already has a lot of additional uses which make it a
generic tool to manipulate date and time stamps, far
beyong setting or displaying the current date.  For
example, see the -f, -j and (especially) -v options.

 > It is not a command to filter files.  'cat' would be a more
 > appropriate place to add this option.

But on the other hand, cat(1) is not a command to format
and manipulate time stamps.  You would have to add many
of date's options to cat in order to make it useful.  For
example, suppose you want to add timestamps with offsets
to a stream:  date(1) can already do that (-v option).
It doesn't make sense to add 90% of date's code to cat.
But adding filtering to date(1) is just a few lines of
code.

Best regards
   Oliver

-- 
Oliver Fromme,  secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing
Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.

 > Can the denizens of this group enlighten me about what the
 > advantages of Python are, versus Perl ?
"python" is more likely to pass unharmed through your spelling
checker than "perl".
        -- An unknown poster and Fredrik Lundh
Received on Mon Sep 04 2006 - 08:42:19 UTC

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