13.8.1. Program Notes for plpr
For the most part, we've avoided scripts like these in which
most of the logic is coded in the shell script. However,
such a minimalist approach is representative of a
wide variety of uses of awk.
Here, awk is called to do only those things that the shell
script can't do (or do as easily).
Manipulating the output of a command and performing
numeric comparisons is an example of such a task.
As a side note, the trap statement
at the end should be at the top of the script, not at the bottom.