Just wrote this because I'm wanting to convert numerous uppercase
variables in lots of shell programs to lowercase, except the initial
letter of a word. Manually, doing this would take forever.
First, however, I need to compile a list of variable names so I know
for what I want to search and replace, then omit certain ones typically
named in all uppercase, like `UID`, `USER`, `HOSTNAME`, etc, which I
will probably do by parsing `env` and various other special parameters
used by Bash.
Fun times.
This is useful, but not if this is _all_ you're after; in those
cases, you're better off just using `free | wc -l` or similar.
However, there may be times you need to count the number of lines in
order to achieve _other_ things programmed in awk, which would then be
crucial!
For example, you may wish to output text informing the user of how many
log entries were discovered in one or more files given to awk.
ENVIRON is a special associative array variable, and LS_COLORS is an
index therein. If you want to see the available variables you could
use, you could execute the trusty `env` command.
This is useful for those times you want to just do something in awk, -
on-the-fly, without having to rely on its standard input (STDIN).
It's especially handy when you want to perform floating-point
arithmetic, if you're not a shell like ZSH which does support it.