mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-29 18:51:15 -03:00
Add while-read example to read docs
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user