Writing Shell Programs

Shell programs are similar to batch files in the DOS world. Unlike DOS batch files, however, shell programs have much more advanced functionality; they are akin to conventional programming languages. Entire books have been written about most available shells; this chapter covers only bash because it is the most popular, and because it is used by default on Red Hat, Caldera, and most popular Linux distributions.

Good Programming Practice

Good shell programs are easy to read and understand. This is vital if someone else must modify your work, or if you come back to it months later to fix or extend something. Badly written code is very difficult to work with and understand. Don't kid yourself about being able to remember what ...

Get Practical Linux now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.