line(1) — Commands
NAME
line − Reads one line from standard input
SYNOPSIS
line
DESCRIPTION
The line command copies one line from standard input and writes it to standard output. Use this command within a shell command file to read from your terminal. The line command always writes at least a newline character.
EXAMPLES
To read a line from the keyboard and append it to a file, enter:
echo ’Enter comments for the log:’
echo ’: \c’
line >>log
This shell procedure displays the message:
Enter comments for the log:
It then reads a line of text from the keyboard and adds it to the end of the file log. The echo ’: \c’ command displays a : (colon) prompt. See the echo command for information about the \c escape sequence.
EXIT VALUES
The line command returns an exit value of 1 on an End-of-File; otherwise, it returns a value of 0 (zero).
NOTES
The line utility has no internationalization features and is considered obsolete. Use the read utility instead.
RELATED INFORMATION
Commands: echo(1), ksh(1), sh(1).
Functions: read(2).