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

Nelson H. F. Beebe beebe at math.utah.edu
Sun Jul 24 04:51:00 AEST 2022


Phil Budne <phil at ultimate.com> suggests "grep -n ." to print numbered
lines.

That mostly works, but loses blank lines, although they are properly
counted.  I typically use

	awk '{print FNR ":" $0}'

instead, which reports all lines, regardless of contents.

-------------------------------------------------------------------------------
- Nelson H. F. Beebe                    Tel: +1 801 581 5254                  -
- University of Utah                                                          -
- Department of Mathematics, 110 LCB    Internet e-mail: beebe at math.utah.edu  -
- 155 S 1400 E RM 233                       beebe at acm.org  beebe at computer.org -
- Salt Lake City, UT 84112-0090, USA    URL: http://www.math.utah.edu/~beebe/ -
-------------------------------------------------------------------------------


More information about the TUHS mailing list