Bourne shell idioms

Here are some portable Bourne shell idioms that I find useful to remember for scripting. The Bourne shell does much more than most users realize, and the ksh and bash extensions are rarely essential. (From the command-line, bash and ksh are vastly more useful.)

My favorite reference book is "Portable Shell Programming --- An Extensive Collection of Bourne Shell Examples" by Bruce Blinn from Prentice Hall.

Get information on a built-in bash command with help. It's much easier than reading the full bash man page at http://www.gnu.org/software/bash/manual/bash.html

For Bash suggestions, I recommend this bash FAQ: http://mywiki.wooledge.org/BashFAQ/

See more sections on Gnu/Linux .

§    Text filtering commands

Administrating from scripts and the command-line often benefit from pipes of text filtering commands. Here are some that are easy to overlook or forget.

§    Files and directories

§    Variables

§    Running commands

§    Manipulating paths

§    Common script chores

§    File descriptors


Return to parent directory.