Different ways to number lines in Unixy environments

So, an aquaintance recently discovered /usr/bin/nl after struggling with paste and seq to get number lines for a file. I mentioned 'Do you know cat -n? There was an article in the 80s about how those switches added to cat were anti-Unix' (Note: Found at http://harmful.cat-v.org/cat-v/unix_prog_design.pdf, on the "bloated" 4.2BSD version). And then I tried to come up with several different ways to do it, and thought up several.

I'm primarily a Linux user, so that's what I'm doing, but I'll test it in some other old and new OS's. Anyone have access to AIX or HP-UX?

Just going to use some temporary output:

$ /etc/update-motd.d/50-landscape-sysinfo > text
$ cat text

  System information as of Sat Dec  2 11:41:44 CST 2017

  System load:  0.06               Processes:              182
  Usage of /:   48.3% of 46.24GB   Users logged in:        1
  Memory usage: 27%                IP address for eth0:    172.16.0.4
  Swap usage:   0%                 IP address for docker0: 172.17.0.1

  Graph this data and manage this system at:
    https://landscape.canonical.com/
There's the obvious:
$ which nl
/usr/bin/nl
$ nl text
       
     1    System information as of Sat Dec  2 11:41:44 CST 2017
       
     2    System load:  0.06               Processes:              182
     3    Usage of /:   48.3% of 46.24GB   Users logged in:        1
     4    Memory usage: 27%                IP address for eth0:    172.16.0.4
     5    Swap usage:   0%                 IP address for docker0: 172.17.0.1
       
     6    Graph this data and manage this system at:
     7      https://landscape.canonical.com/
nl method tested: Huh, so it skips blank lines; I always use cat -n, so I didn't know that ([pause while reading man page]). Ok, you can get it to number every line with:
$ nl -ba text
     1
     2    System information as of Sat Dec  2 11:41:44 CST 2017
     3
     4    System load:  0.06               Processes:              182
     5    Usage of /:   48.3% of 46.24GB   Users logged in:        1
     6    Memory usage: 27%                IP address for eth0:    172.16.0.4
     7    Swap usage:   0%                 IP address for docker0: 172.17.0.1
     8
     9    Graph this data and manage this system at:
nl method tested: Ok, next up the bloated cat one:
$ which cat
/bin/cat
$ cat -n text
     1
     2    System information as of Sat Dec  2 11:41:44 CST 2017
     3
     4    System load:  0.06               Processes:              182
     5    Usage of /:   48.3% of 46.24GB   Users logged in:        1
     6    Memory usage: 27%                IP address for eth0:    172.16.0.4
     7    Swap usage:   0%                 IP address for docker0: 172.17.0.1
     8
     9    Graph this data and manage this system at:
    10      https://landscape.canonical.com/
cat -n method tested: There's also -n in grep:
$ grep -n ^ text | sed 's/:/ /'
1 
2   System information as of Sat Dec  2 11:41:44 CST 2017
3 
4   System load:  0.06               Processes:              182
5   Usage of /:   48.3% of 46.24GB   Users logged in:        1
6   Memory usage: 27%                IP address for eth0:    172.16.0.4
7   Swap usage:   0%                 IP address for docker0: 172.17.0.1
8 
9   Graph this data and manage this system at:
10     https://landscape.canonical.com/
grep -n method tested: There's also the rarely used 'pr' command, used for sending stuff to the line printer, way-back-when:
$ pr -t -n text
    1   
    2     System information as of Sat Dec  2 11:41:44 CST 2017
    3   
    4     System load:  0.06               Processes:              182
    5     Usage of /:   48.3% of 46.24GB   Users logged in:        1
    6     Memory usage: 27%                IP address for eth0:    172.16.0.4
    7     Swap usage:   0%                 IP address for docker0: 172.17.0.1
    8   
    9     Graph this data and manage this system at:
   10       https://landscape.canonical.com/
Simple enough. Ok, how about awk:
$ awk '{print ++n " " $0}' text
1 
2   System information as of Sat Dec  2 11:41:44 CST 2017
3 
4   System load:  0.06               Processes:              182
5   Usage of /:   48.3% of 46.24GB   Users logged in:        1
6   Memory usage: 27%                IP address for eth0:    172.16.0.4
7   Swap usage:   0%                 IP address for docker0: 172.17.0.1
8 
9   Graph this data and manage this system at:
10     https://landscape.canonical.com/
awk var++ method tested: But there's also the NR pre-set variable, which I rarely remember:
$ awk '{print NR " " $0}' text
1 
2   System information as of Sat Dec  2 11:41:44 CST 2017
3 
4   System load:  0.06               Processes:              182
5   Usage of /:   48.3% of 46.24GB   Users logged in:        1
6   Memory usage: 27%                IP address for eth0:    172.16.0.4
7   Swap usage:   0%                 IP address for docker0: 172.17.0.1
8 
9   Graph this data and manage this system at:
10     https://landscape.canonical.com/
awk NR method tested: Both of those should work in awk, nawk, and gawk. In vi, there's the handy "set number" option. How about we use ex, the line-oriented precursor to vi?
$ printf 'set number\ng/^/p\n' | ex text
      1  
      2   System information as of Sat Dec  2 11:41:44 CST 2017
      3  
      4   System load:  0.06               Processes:              182
      5   Usage of /:   48.3% of 46.24GB   Users logged in:        1
      6   Memory usage: 27%                IP address for eth0:    172.16.0.4
      7   Swap usage:   0%                 IP address for docker0: 172.17.0.1
      8  
      9   Graph this data and manage this system at:
     10     https://landscape.canonical.com/
ex method tested: Various ways to do the printing. 1,$p also works. There's the super-venerable /bin/ed:
$ echo '1,$n' | ed -s text
1
2         System information as of Sat Dec  2 11:41:44 CST 2017
3
4         System load:  0.06               Processes:              182
5         Usage of /:   48.3% of 46.24GB   Users logged in:        1
6         Memory usage: 27%                IP address for eth0:    172.16.0.4
7         Swap usage:   0%                 IP address for docker0: 172.17.0.1
8
9         Graph this data and manage this system at:
10          https://landscape.canonical.com/
ed method tested: Too bad that doesn't work in sed. I came up with this in sed to print a line number then the line, and wrap every 2 lines together:
$ sed = text | paste - - 
1 
2   System information as of Sat Dec  2 11:41:44 CST 2017
3 
4   System load:  0.06               Processes:              182
5   Usage of /:   48.3% of 46.24GB   Users logged in:        1
6   Memory usage: 27%                IP address for eth0:    172.16.0.4
7   Swap usage:   0%                 IP address for docker0: 172.17.0.1
8 
9   Graph this data and manage this system at:
10     https://landscape.canonical.com/
sed method tested: ksh/bash file-redirection method (provided seq installed). This is getting kinda complicated, so not going far beyond this:
$ paste <(seq $(wc -l < text)) text
1
2         System information as of Sat Dec  2 11:41:44 CST 2017
3
4         System load:  0.06               Processes:              182
5         Usage of /:   48.3% of 46.24GB   Users logged in:        1
6         Memory usage: 27%                IP address for eth0:    172.16.0.4
7         Swap usage:   0%                 IP address for docker0: 172.17.0.1
8
9         Graph this data and manage this system at:
10          https://landscape.canonical.com/
ksh/bash method tested: