Accepting input while a script is running

In the last section, we showed you that you can require that information be provided along with the script in order for the script to run, but it's easy to forget to input the information and thus not get the results you expected. You can also require input while a script is running. The script runs, you input some information, then the script continues (probably) using the information that you input (Figure 10.8). In this case, the script counts misspelled words, but you can apply it to anything you want.

Figure 10.8. You can also input information while a script is running.

To accept input while ...

Get Unix: Visual QuickStart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.