From owner-cvs-all Sat May 5 2: 0:10 2001 Delivered-To: cvs-all@freebsd.org Received: from Awfulhak.org (awfulhak.demon.co.uk [194.222.196.252]) by hub.freebsd.org (Postfix) with ESMTP id D7C1B37B422; Sat, 5 May 2001 02:00:02 -0700 (PDT) (envelope-from brian@Awfulhak.org) Received: from hak.lan.Awfulhak.org (root@hak.lan.Awfulhak.org [172.16.0.12]) by Awfulhak.org (8.11.3/8.11.3) with ESMTP id f458xdq19531; Sat, 5 May 2001 09:59:39 +0100 (BST) (envelope-from brian@lan.Awfulhak.org) Received: from hak.lan.Awfulhak.org (brian@localhost [127.0.0.1]) by hak.lan.Awfulhak.org (8.11.3/8.11.3) with ESMTP id f4590IB84808; Sat, 5 May 2001 10:00:18 +0100 (BST) (envelope-from brian@hak.lan.Awfulhak.org) Message-Id: <200105050900.f4590IB84808@hak.lan.Awfulhak.org> X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 To: John Baldwin Cc: Brian Somers , Kris Kennaway , Brian Somers , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org, brian@Awfulhak.org Subject: Re: cvs commit: src/usr.bin Makefile src/usr.bin/nl Makefile nl. In-Reply-To: Message from John Baldwin of "Fri, 04 May 2001 16:11:23 PDT." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 05 May 2001 10:00:18 +0100 From: Brian Somers Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > On 04-May-01 Brian Somers wrote: > >> > It essentially stuffs numbers in front of lines. > >> > >> About like "awk '{ printf "%d:%s\n", NR, $0 }'" then? > > > > That was my original argument (I suggested ``cat -n''), but nl does > > more than just that. See the man page. > > Can I tune my awk script appropriately so that I can obtain the desired results > in one line of awk that I can in one invocation of nl? > > Hmm, looking at the manpage, this wouldn't be that hard to do in awk. In fact, > requiring special lines to mark the start of sections, etc. almost hand tailors > this for awk or some other similar language. I wonder if this is simply a case > of a script converted to C. Awk is an interpreted C language. There are many things that could be re-implemented using it. The same thing holds true (even more so) for perl. > Then again, we have cut(1). There are probably lots more. > -- > > John Baldwin -- http://www.FreeBSD.org/~jhb/ > PGP Key: http://www.baldwin.cx/~john/pgpkey.asc > "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ -- Brian Don't _EVER_ lose your sense of humour ! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message