|
|
HP-UX Reference > Lline(1)HP-UX 11i Version 2: December 2007 Update |
|
NAMEline — read one line from user input DESCRIPTIONline copies one line (up to a new-line) from the standard input and writes it on the standard output. It returns an exit code of 1 on EOF and always prints at least a new-line. It is often used within shell files to read from the user's terminal. Optionsline recognizes the following command-line option:
EXAMPLESThe following lines in a shell script prompt for a file name and display information about the file: echo 'Enter file name: \c' reply=`line` ls -l $reply To limit the response time to 10 seconds, use the form: reply=`line -t 10` then test for no response. If no response occurs before timeout expires, a default behavior should be provided. |
|