From owner-freebsd-current@FreeBSD.ORG Mon Aug 14 12:21:16 2006 Return-Path: X-Original-To: freebsd-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 03F0916A4DD for ; Mon, 14 Aug 2006 12:21:16 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id 36C0C43D46 for ; Mon, 14 Aug 2006 12:21:14 +0000 (GMT) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (pknwlu@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id k7ECL7va082306 for ; Mon, 14 Aug 2006 14:21:12 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id k7ECL7JJ082305; Mon, 14 Aug 2006 14:21:07 +0200 (CEST) (envelope-from olli) Date: Mon, 14 Aug 2006 14:21:07 +0200 (CEST) Message-Id: <200608141221.k7ECL7JJ082305@lurza.secnetix.de> From: Oliver Fromme To: freebsd-current@FreeBSD.ORG In-Reply-To: <20060812034008.GC80768@gothmog.pc> X-Newsgroups: list.freebsd-current User-Agent: tin/1.8.0-20051224 ("Ronay") (UNIX) (FreeBSD/4.11-STABLE (i386)) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Mon, 14 Aug 2006 14:21:12 +0200 (CEST) X-Mailman-Approved-At: Mon, 14 Aug 2006 13:04:15 +0000 Cc: Subject: Re: suggested addition to 'date' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-current@FreeBSD.ORG List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 12:21:16 -0000 Giorgos Keramidas wrote: > Sam Leffler wrote: > > Julian Elischer wrote: > > > At various times I've wanted to add timestamps to logfiles as they are > > > generated.. > > > > > > usually this has involved perl or something to do it. > [...] > Using Perl and ``Time::HiRes qw(gettimeofday)'' is the best trick I've > found so far for this sort of thing :-/ In the "good old days" when FreeBSD still hat gnu awk as /usr/bin/awk, it was pretty trivial to do: ls | awk '{print strftime("%+: ") $0}' Unfortunately, our "shiny new" awk doesn't have strftime() anymore. (One of the reasons why I always install gnu awk from ports and let it override the crippled /usr/bin/awk.) I don't think it deserves bloating date(1) or even a completely new tool. There are tools which can do the job easily and efficiently (e.g. gnu awk, see above). Just my 2 cents. 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. "C is quirky, flawed, and an enormous success." -- Dennis M. Ritchie.