Understanding shell scripts


UNIX shells are actually fairly sophisticated programming languages oriented towards managing the execution of processes, so there's a lot more to them than I will cover here.

I will mainly describe the Bourne shell (/bin/sh), which is the most common shell used for system scripting tasks.

sh is by modern standards a rather poor interactive shell, but remains a useful scripting tool because of its low overhead and simple Algol-like (or Pascal-like, for you young-uns) script syntax. ksh and bash are pretty backward-compatible with sh script syntax while adding useful interactive features (command history, command/filename completion, command-line editing).

csh and tcsh are mainly intended as interactive shells and have very different, C-style syntax for their scripting capabilities; unfortunately, it was not as well thought-out as the Bourne shell scripting language and has many bugs and pitfalls (see Csh Programming Considered Harmful for a detailed technical discussion).

Next ->


Steve VanDevender
Last modified: Mon Jul 7 13:29:48 PDT 2003