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
readbuilt-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:
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime