Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Aug 2006 18:12:02 +0100
From:      Brian Candler <B.Candler@pobox.com>
To:        Julian Elischer <julian@elischer.org>
Cc:        Aleksey Perov <algardo@sura.ru>, freebsd-current@freebsd.org
Subject:   Re: suggested addition to 'date'
Message-ID:  <20060817171202.GB671@uk.tiscali.com>
In-Reply-To: <44E38F2C.8000207@elischer.org>
References:  <44DD4510.5070002@elischer.org> <20060816131824.67a8053b.algardo@sura.ru> <44E38F2C.8000207@elischer.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Aug 16, 2006 at 02:33:32PM -0700, Julian Elischer wrote:
> I can not install ports onto these machines. They are appliances.
> 
> I will simply put the unhancement in out own cvs tree, and the 
> enhancement will be private.
> I'm still comletely amazed that no-one but me thinks this is a good idea 
> as it seems absolutly
> obvious to me  and it doesn't affect date's usual behaviour in the 
> slightest.

FWIW I am also against, in a non-vehement way. My reasons are:

1. I don't like to encourage the writing of non-portable scripts, which will
run on FreeBSD but not Linux, any other *BSD or indeed any other Unix in
existence. Linux scripts which start #!/bin/sh but use bash-isms are
particularly annoying... scripts which rely on non-standard additions to
core utilities are also a pain.

(I'm not a POSIXLY_CORRECT extremist though. I apply my own woolly
definition of 'standard' here)

2. I object to feature bloat, not especially because it makes the core
utilities and their manpages larger (we're only talking a few bytes in this
particular case), but because it makes finding the right command and the
right flag more difficult.

Suppose you came along to a system knowing that there was a command
somewhere to add timestamps to log streams, but couldn't remember what it
was. I personally would never guess that it was "date" (*). 'man -k'
wouldn't be able to find it, because this hidden feature is unlikely to make
it into the one-line description.

3. One command doing many different things seems to go against the Unix
philosophy of simple utilities doing one thing each.

>From the point of view of (2) and (3), I'd rather than there was a
completely separate utility for adding timestamps to streams, even if it
shares 90% of its code with 'date'.

4. The other thing I'm uncomfortable with is that this modification to date
does handles one specific type of timestamp addition - adding a timestamp to
the start of a line, where lines are terminated by \n. Whilst this is a
common case, it's certainly not the only case where I've wanted to add
timestamps. That makes it feel like a special-case frig.

Regards,

Brian.

(*) The nearest similar standard Unix command I can think of is nl(1)



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