From owner-freebsd-current@FreeBSD.ORG Tue Aug 15 01:54:21 2006 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2646C16A4DA for ; Tue, 15 Aug 2006 01:54:21 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5DA3C43D4C for ; Tue, 15 Aug 2006 01:54:20 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from gothmog.pc (patr530-a077.otenet.gr [212.205.215.77]) (authenticated bits=128) by igloo.linux.gr (8.13.7/8.13.7/Debian-2) with ESMTP id k7F1rmjk010958 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 15 Aug 2006 04:53:52 +0300 Received: from gothmog.pc (gothmog [127.0.0.1]) by gothmog.pc (8.13.7/8.13.7) with ESMTP id k7F1rU6t002409; Tue, 15 Aug 2006 04:53:32 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from giorgos@localhost) by gothmog.pc (8.13.7/8.13.7/Submit) id k7F1rSCC002408; Tue, 15 Aug 2006 04:53:28 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Tue, 15 Aug 2006 04:53:28 +0300 From: Giorgos Keramidas To: Julian Elischer Message-ID: <20060815015328.GA2349@gothmog.pc> References: <44DD4510.5070002@elischer.org> <868xlrwtgf.fsf@xps.des.no> <44E0BB4D.6010103@elischer.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44E0BB4D.6010103@elischer.org> X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (score=-4.096, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.30, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Spam-Status: No Cc: Dag-Erling Sm?rgrav , current@freebsd.org Subject: Re: suggested addition to 'date' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Aug 2006 01:54:21 -0000 On 2006-08-14 11:05, Julian Elischer wrote: >Dag-Erling Sm?rgrav wrote: >>Julian Elischer writes: >>>At various times I've wanted to add timestamps to logfiles as >>>they are generated.. >> >> while read line ; do echo $(date '+%Y-%m-%d %H:%M:%S') "$line" ; done > > while this is true, if you had read the rest of the thread you > would have seen the words "without running date for every > line". That's true, but a bit harsh. Julian, we have probably caused you an inordinate amount of trouble and wasted too much of your time already with this, so I understand why you would be frustrated about replies like the one from DES. I'm sorry if I have, by my replying to the thread, caused you some of the frustration (especially since I initially thought this was cool and a nice feature to have and changed my mind later). Please bear with this last message from me about modifying date(1), and then I'll shut up until this issue is resolved by people who know more than me about src/ stuff :-) > I even said that it could be done using shell if one WAS > willing to run date for each line. Yes. But that would be horribly inefficient. After a fair bit of thought, my reluctancy to agree that a patch for date(1) is in order is based on at least the following reasons: - Making such a change would be a diversion from what date(1) traditionally does. It's a new feature and it would probably be useful, but I have doubts about its usefulness as an inline part of date(1). - There are countless ways to do the same thing with a filter, some of which also have timestamp granularity far better than what date(1) can ever hope to provide (at least without adding custom strftime(3) format specifiers, which is a needless diversion from standards). For example, a Perl-based filter can use gettimeofday() and provide timestamps with sub-second accuracy. This is not (currently) possible with strftime(3), which is what date(1) is based on :( - Now that this thread has been spawned, people who want to do something like this can easily find several suggestions to satisfy their needs, without modifying date. Admittedly this is a very weak argument for *NOT* adding new features, but still a thought that raises a few doubts about the immediate usefulness of the feature. Just my $0.02 on the topic. If you still think it's a good thing to have and somebody(TM) comes up with a patch that doesn't cause people too many problems, feel free to ignore everything above :) Regards, Giorgos