On Sun, Jun 26, 2011 at 05:23:18AM +0400, Mike Korbakov wrote:
> I didn't mean GNU tools. May be, not most of all old UNIX'es, but most modern
> systems has textools.
> Read bottom of page:
> http://www.freebsd.org/cgi/man.cgi?query=nl&apropos=0&sektion=1&manpath=FreeBSD+Ports+8.2-RELEASE&format=html
> historical links:
> http://minnie.tuhs.org/cgi-bin/utree.pl?file=pdp11v/usr/src/cmd/nl.c
> http://minnie.tuhs.org/cgi-bin/utree.pl?file=SysIII/usr/src/cmd/nl.c
Uh, and it's even in POSIX:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/nl.html
Dunno if it should be imported.
> gnl -v 0 , cat -n , awk '{ print " " FNR-1 " " $0 }' leads to three
> different results, just try.
> But in our case awk produced usefull code.
cat -n always starts at 1. ;) I just noticed the awk line has one space
too much, but that doesn't matter in this case.