Add while-read example to read docs

This commit is contained in:
Fabian Homborg 2017-01-07 14:31:05 +01:00
parent e1b445f934
commit c5a6d87c5e

View File

@ -51,4 +51,9 @@ The following code stores the value 'hello' in the shell variable `$foo`.
\fish
echo hello|read foo
# This is a neat way to handle command output by-line:
printf '%s\n' line1 line2 line3 line4 | while read -l foo
echo "This is another line: $foo"
end
\endfish