I've also maintained a column limit of 80, for smaller terminals.
Some of these description changes are superfluous, but either improve
clarity, or make things a touch more concise, I believe.
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.
Many uses for this!
Say you install a large set of updates, so want to cross-check the old
list to the new one, in order to find out which new executables were
installed.
Or, perhaps less obscure, you might this list, without the `-printf`
part, to check their permission and ownership settings.
The examples given using xargs are so far mostly never or rarely ever
best used or even well used with xargs, such as with find, which is
popular, unfortunately.
My reason for adding counters to some of these examples, is that, as an
educational resource, I believe it's important users understand what is
and is _not_ good practice; this is, at least, how I taught myself.
The `-i` flag with `sed` means "in-place", if you're curious; the use
thereof allows for making actual changes to the file, not just
superfluously, such as for additional parsing.
The `s///` is a simple substitution, wherein the `s` marks that it's a
substitution, the `/` marks the boundaries*, and the final boundary can
be suffixed with various flags, such as `g`, for global operations, -
and `i`, for case-insensitive operations.
* required, but the slash can switched for something else, if needed, -
such as `|`, which is commonly used for paths. For example:
`s|/path/to/file|/path/file|`