Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 04 May 2001 16:11:23 -0700 (PDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Brian Somers <brian@Awfulhak.org>
Cc:        Kris Kennaway <kris@obsecurity.org>, Brian Somers <brian@FreeBSD.org>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/usr.bin Makefile src/usr.bin/nl Makefile nl.
Message-ID:  <XFMail.010504161123.jhb@FreeBSD.org>
In-Reply-To: <200105042255.f44MtdB60903@hak.lan.Awfulhak.org>

next in thread | previous in thread | raw e-mail | index | archive | help

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.

Then again, we have cut(1).

-- 

John Baldwin <jhb@FreeBSD.org> -- 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/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.010504161123.jhb>