Basic Shell Script Construction
Yeah, I know. You’re dying to start creating some shell scripts, but haven’t been able to do that yet. So, in this chapter, we’ll look at the basics of shell script construction. We’ll then wrap things up by looking at some shell scripts that are both practical and useful.
Many of the techniques that I’m presenting in this chapter work for any shell, but I’ll also present some that might only work on bash
. So, just to keep things simple though, I’ll be sticking with bash
for now. In Chapter 22, Using the zsh Shell, I’ll show you techniques that are specific to zsh
. In Chapter 19, Shell Script Portability, I’ll show you techniques that will work on a wide variety of shells.
The topics that you’ll see in this chapter include:
- Understanding basic shell script construction
- Performing tests
- Understanding subshells
- Understanding scripting variables ...