On 17 July 2016 at 08:21, Stewart C. Russell via talk <talk@gtalug.org> wrote:
A discussion came up in the Toronto Raspberry Pi Meetup* about suggestions for learning to work in bash. We didn't come up with anything much, but if you have any suggestions, I'd be grateful to hear them.

I have been particularly happy with Chris F.A. Johnson's books, particularly in view of his preference for trying to be somewhat shell-agnostic, to use generic POSIX facilities where possible.

The attempt (which mayn't *always* work, of course) reduces the likelihood that your code will be rife with features that were introduced in one particular version of Bash that might cause all your code to catch fire the moment you find that:
a) Oops, I upgraded to a version of Ubuntu that has a different version of Bash that changed that feature;
b) Oops, I need to run that script on AIX where they don't have Bash, but rather Korn Shell
c) Oops, I need to run that script on a version of CentOS from 2013 that didn't include that new feature that was added in Bash version 4.2

The *clever* things that Chris points out wind up being pretty portable and pretty good at simplifying code.  (Dang, where are my notes from his last talk?  It's been too long!!!)  And they tend to fit well with the traditional Unix "philosophy" of the code attempting to be parsimonious.  Short, good, reusable abstractions.
--
When confronted by a difficult problem, solve it by reducing it to the
question, "How would the Lone Ranger handle this?"