Title graphic

Here Is Where The Fun Begins

With the thousands of commands available for the command line user, how can you remember them all? The answer is, you don't. The real power of the computer is its ability to do the work for you. 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 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 your Linux machine. So let's have some fun!

Contents

  1. Writing Your First Script And Getting It To Work
  2. Editing The Scripts You Already Have
  3. Here Scripts
  4. Variables
  5. Command Substitution And Constants
  6. Shell Functions
  7. Some Real Work
  8. Flow Control - Part 1
  9. Stay Out Of Trouble
  10. Keyboard Input And Arithmetic
  11. Flow Control - Part 2
  12. Positional Parameters
  13. Flow Control - Part3
  14. Errors And Signals And Traps (Oh My!) - Part 1
  15. Errors And Signals And Traps (Oh My!) - Part 2

© 2000-2014, William E. Shotts, Jr. Verbatim copying and distribution of this entire article is permitted in any medium, provided this copyright notice is preserved.

Linux® is a registered trademark of Linus Torvalds.