Unix Shell Scripting

Written by Shirley Parker
Bookmark and Share

UNIX Shell Scripting has been said to be the UNIX philosophy in action. What that means is open to interpretation, of course, but its world does include Command Line Interfaces instead of icons. Programmers in UNIX are also inclined, and taught, to write programs that do just one thing well and to write programs that work together.

Basic UNIX classes cover UNIX commands like sed, grep and find. A class in UNIX shell scripting takes that somewhat further by combining the commands in order to handle larger tasks in the UNIX environment. There are a number of shells used: Bourne (bsh), Korn (ksh) and yes, the Bourne again shell (bash). Ksh and bash are said to be excellent enhancements of bsh.

A person can be forgiven for wondering why they would need a shell script in the first place. (There are others, including the C shell (ouch!), as well as rich scripting languages such as Perl or Python.) Shell scripts are useful in automating many tasks, such as backups or any repetitive file operations. The savings in time and aggravation can sometimes be considerable, but the various shell scripts should be used properly; the right tool handles any job more efficiently. You wouldn't use a soft toothbrush to clean the rocks in an outdoor fish pond.

Learning UNIX Shell Scripting

As with other IT classes, many sources exist for learning UNIX Shell Scripting. A good workshop at a university extension or community computer center may be a great choice, if it's within a reasonable distance. If the instructor provides handouts in lieu of a manual, they're probably full of sample scripts. The best are really good. Bourne's Introduction to the UNIX Shell and The UNIX Programming Environment are still excellent resources, if you can find a copy of them.


Bookmark and Share