May 2017
Beginner
552 pages
28h 47m
English
The awk script stores each of the lines into an associative array using the line number as the index (NR returns the line number). After reading all the lines, awk executes the END block. The NR variable is maintained by awk. It holds the current line number. When awk starts the END block, NR is the count of lines. Using lno=NR in the { } block iterates from the last line number to 0, to print the lines in reverse order.