[PLUG] bash reference books

Martin A. Brown martin at linux-ip.net
Tue May 1 22:43:43 UTC 2012


Hello Rich,

 :    I have a first edition (1995) of "Learning the bash Shell" and 
 : it's time to get a newer reference. I see that Powell's has more 
 : than the ORA edition (now in it's third iteration), and I'm 
 : seeking recommendations whether to buy the ORA version or one of 
 : the others.
 : 
 :    Any opinions here? (Rhetorical question, eh?)

I like bash.  Here are some of my notes from an early set of 
recommendations for learning about bash.

  http://tinyurl.com/mr957

  An excellent dead-tree book, _Linux Shell Scripting with Bash_
  by Ken O. Burtch provides a comprehensive overview of shell
  programming.

  http://www.oreilly.com/catalog/bash3/index.html

  The O'Reilly _Learning the Bash Shell_ book is generally fairly
  good.  Sometimes it reads like a manual, and sometimes it reads
  like a tutorial.  Particularly valuable are the chapters on
  command-line processing and process handling.

  http://tldp.org/LDP/abs/html/

  Mendel Cooper, working for The Linux Documentation Project has
  written this rich document which describes a wide variety of
  very useful shell programming features (in bash), as well as
  providing a fair number of practical examples of shell.

  http://www.shelldorado.com/

  This is a useful collection of shell tidbits and tips.

  http://wooledge.org/mywiki/BashFaq

  Contained in this Wiki are a large number of shell snippets (of
  varying quality) which answer any number of "How do I..."
  questions.  I think it's freenode which has #bash (?) and the 
  cantankerous primary character behind wooledge.org hangs out
  here.

  http://partmaps.org/era/unix/award.html  # -- fun

  The gratutitous use of 'cat' (/bin/cat) is a fairly common
  mistake for beginning shell users.  At this site, there is an
  explanation of this and other similar shell faux pas, which can
  help to provide insight into shell programming.

I wrote a few very targetted tips on using (long ago, in a different 
universe) which are little discursive tips for using shell.

  http://linux-ip.net/misc/madlug/shell-tips/tip-0.txt
  http://linux-ip.net/misc/madlug/shell-tips/tip-1.txt
  http://linux-ip.net/misc/madlug/shell-tips/tip-2.txt
  http://linux-ip.net/misc/madlug/shell-tips/tip-3.txt

Here are my suggestions for today on the how to go about learning 
shell:

  * learn pipes; learn them cold
  * separate learning shell from CLI tools (rm, mv, cut, sed)
  * learn how to debug shell (set -x && set -e)
  * learn about using shell variables safely
  * learn how to deal with files and various redirections
  * learn to use the 'test' builtin (or command)
  * learn all about quoting; learn this cold
  * learn looping (while : ; do ... done)
  * learn how parameter expansions work
  * learn the 'find' utility
  * learn how to deal with files safely
  * distinguish aliases, commands and builtins
  * learn different shells: sh, ash, zsh, dash ...
  * now go on to the fancy stuff like locales, forking, xargs
    locking, stat, shell functions

I would conclude with one bold statement.  Don't even bother trying 
to learn how arrays work in shell.  If you get that far with shell 
and are trying to use arrays, then you are probably not using the 
correct language.

Now that I have said that, I imagine that somebody out there will 
likely whip up an amazing use for shell arrays....  In my opinion, 
though they are considerably more headache than they are worth.

-Martin

-- 
Martin A. Brown
http://linux-ip.net/



More information about the PLUG mailing list