mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 10:43:32 +08:00
Add while-read example to read docs
This commit is contained in:
parent
e1b445f934
commit
c5a6d87c5e
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user