DistributedNetworks DistributedNetworks

Shell Components   «Prev  Next»
Lesson 9

Components of a Shell Program

This module introduced you to the programming concepts that are used in creating a shell script. If you have programmed before, these concepts may be familiar to you, though their application in shell scripts may differ from other situations. Now that you understand these concepts, you are ready to dive into creating your first real shell script.

Terms and concepts

This module introduced you to the following terms and concepts:
  1. Built-in commands
  2. External commands
  3. Managing input and output in a script
  4. A shell script as a command line macro
  5. Tests within if/then/else statements
  6. Variables in shell scripts
  7. Control and looping structures
  8. Regular expressions

It is possible to create shell scripts that are far more interactive and involving than the regular
  1. Press 1 to continue,
  2. Press 2 to exit
type menu systems that are usually passed off as interactive shell scripts. The shell can do much more than is regularly exploited, and although the shell is far from being the perfect language for game development, I hope this recipe will inspire more creative uses of shell scripts and particularly the newer features available in the bash shell (such as arrays) and in the GNU environment (like sleep being able to perform sub-second sleeps, without which this game is much less fun to play).