Chapter 8. Writing interactive scripts

Table of Contents

1. Displaying user messages
1.1. Interactive or not?
1.2. Using the echo built-in command
2. Catching user input
2.1. Using the read built-in command
2.2. Prompting for user input
2.3. Redirection and file descriptors
2.4. File input and output
3. Summary
4. Exercises

Abstract

In this chapter we will discuss how to interact with the users of our scripts:

  • Printing user friendly messages and explanations

  • Catching user input

  • Prompting for user input

  • Using the file descriptors to read from and write to multiple files