shell scripting book
The following code will read the line into a
variable called message, looping around until there is no more input (read returns non-zero if an
end-of-file was read, so the while loop ends — this will be looked at in greater detail in Chapter 6).
$ while read message
>
do
>
echo $message
> done < /etc/motd
$ while read message
>
do
>
echo $message
> done < /etc/motd
Comments
Post a Comment