Date: Mon, 28 Aug 2006 17:45:49 +0200 (CEST) From: Oliver Fromme <olli@lurza.secnetix.de> To: freebsd-current@FreeBSD.ORG, jhb@FreeBSD.ORG Subject: Re: suggested addition to 'date' Message-ID: <200608281545.k7SFjn6l063922@lurza.secnetix.de> In-Reply-To: <200608251003.28528.jhb@freebsd.org>
index | next in thread | previous in thread | raw e-mail
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. That would also enable you to be more > > flexible with the placement of the timestamps. > > For example: > > > > $ printf 'foo\nbar\nbaz\n' | date +'%H:%M:%S %*' > > 16:39:58 foo > > 16:39:58 bar > > 16:39:58 baz > > I prefer this of all the suggestions so far. It's not very difficult, so I created a patch which does exactly that (includes an addition for the manpage, too). I've submitted it as bin/102609: http://www.freebsd.org/cgi/query-pr.cgi?pr=102609 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.home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200608281545.k7SFjn6l063922>
