Here is Where the Fun Begins
With the thousands of commands available to the command line user, how can we remember them all? The answer is, we don't. The real power of the computer is its ability to do the work for us. To get it to do that, we use the power of the shell to automate things. We write shell scripts.
What are Shell Scripts?
In the simplest terms, a shell script is a file containing a series of commands. The shell reads this file and carries out the commands as though they have been entered directly on the command line.
The shell is somewhat unique, in that it is both a powerful command line interface to the system and a scripting language interpreter. As we will see, most of the things that can be done on the command line can be done in scripts, and most of the things that can be done in scripts can be done on the command line.
We have already covered many shell features, but we have focused on those features most often used directly on the command line. The shell also provides a set of features usually (but not always) used when writing programs.
Scripts unlock the power of our Linux machine. So let's have some fun!
Contents
- Writing Our First Script and Getting It to Work
- Editing the Scripts We Already Have
- Here Scripts
- Variables
- Command Substitution and Constants
- Shell Functions
- Some Real Work
- Flow Control - Part 1
- Stay Out of Trouble
- Keyboard Input and Arithmetic
- Flow Control - Part 2
- Positional Parameters
- Flow Control - Part 3
- Errors and Signals and Traps (Oh My!) - Part 1
- Errors and Signals and Traps (Oh My!) - Part 2