line(1) DG/UX 5.4R3.00 line(1)
NAME
line - read one line
SYNOPSIS
line
DESCRIPTION
Line 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.
EXAMPLES
This example is a shell program that gathers information about users.
echo "ENTER YOUR NAME"
NAME=`line`
echo "ENTER YOUR DEPARTMENT NUMBER:"
DEPT=`line`
echo "$NAME $DEPT" >> personnel
First, the program queries you for your name. Because line is
surrounded by grave accents, the program executes it, and line reads
the name and assigns the name to the variable "NAME". Then the
program asks for your department and office extension. The program
assigns these values to "DEPT" The last line appends "NAME"and "DEPT"
to the file "personnel".
SEE ALSO
sh(1), read(2).
Licensed material--property of copyright holder(s) 1