资料内容:
Getting User Input
While providing command line options and parameters is a great way to get data from
your script users, sometimes your script needs to be more interactive. There are times
when you need to ask a question while the script is running and wait for a response from
the person running your script. The bash shell provides the read command just for this
purpose.
Basic Reading
The read command accepts input from the standard input (the keyboard) or from
another file descriptor (see Chapter 14). After receiving the input, the read command
places the data into a standard variable. Here's the read command at its simplest: