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.Received on Mon Aug 14 2006 - 10:21:16 UTC
This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:59 UTC