Chapter 5. Creating Interactive Scripts
This chapter shows how to read the keyboard in order to create interactive scripts.
The topics covered in this chapter are:
- How to use the
read
built-in command to query the keyboard. - The different ways to use
read
. - The use of traps (interrupts).
The reader will learn how to create interactive scripts.
The scripts we have looked at up to this point have run without much user interaction. The read
command is used to create scripts that can query the keyboard. The code can then take action based on the input.
Here is a simple example: