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

Ralph Corderoy ralph at inputplus.co.uk
Sat Jul 23 23:36:56 AEST 2022

Hi Rob,

> Very odd. I thought so too, but the 8th Edition manual says pr -n
> prints in n columns, while the 9th and 10th say it numbers the lines.

8th Edition's pr.c has -n and -x which both turn on line numbers.
The optional argument gives the width used for the line number.

    case 'n':
    case 'x': /* retained for historical reasons */
            if ((Numw = intopt(argv, &Nsepc)) <= 0)
                    Numw = NUMW;

    if (Lnumb && C != EOF && (colno == 0 || Multi == 'a')) {
            if (Page >= Fpage) {
                    printf("%*ld", Numw, Buffer ?
                            Colpts[colno].c_lno++ : Lnumb);
                    Outpos += Numw;

I think -n and -x are undocumented in the matching man page.

The -n you're referring to is an italic ā€˜nā€™, e.g. -3 for three columns.

    .BI \- n
    .IR n -column

Cheers, Ralph.

More information about the TUHS mailing list