Introduction

The shell has a complete programming language interpreter built into it. The shell supports a wide variety of iterative and branching structures (that is, loops and if's) that are covered in the man page for the bash shell.

Shell programming comes in two flavors: shell scripts and shell functions. Shell scripts, once defined, can be executed just like any other executable. Shell functions are similar to shell scripts but are defined in the environment. This simply means that they load much faster than shell scripts and can change the current environment.