[TUHS] Line Numbers Before SysIII nl? BSD num?

Dan Cross crossd at gmail.com
Sat Jul 23 22:00:10 AEST 2022


On Sat, Jul 23, 2022 at 7:20 AM John Cowan <cowan at ccil.org> wrote:
> On Sat, Jul 23, 2022 at 7:03 AM Dan Cross <crossd at gmail.com> wrote:
>> It may be worth noting that BSD had `cat -n` in 4BSD by October, 1980: https://minnie.tuhs.org/cgi-bin/utree.pl?file=4BSD/usr/man/man1/cat.1
>>
>> That may explain the relatively late incorporation of `nl` in, at least, the BSD lineage.
>
> An obvious approach, which would leave no real traces in documentation, would be:
>
> $ awk '{print NR, $0}'
>
> A more precise emulation would be more of a pain to type:
>
> $ awk '{printf("%6d\t%s\n", NR, $0)}'
>
> but perfectly usable in a script.

Yes, but awk wasn't widely available until 7th edition. I imagine work
on it began before `num` in 2BSD, but few outside of Bell Labs would
have seen it prior to 1978 or so.

I wonder if the use-case was just sufficiently rare that no one felt like
building a special tool and it was just done on an ad-hoc basis, if
necessary.

        - Dan C.


More information about the TUHS mailing list