read: add example using 'while' (#5258)

Copied from `while`

As discussed in #5258, this replaces a less useful example to maintain
the limit of 8 examples per page.
This commit is contained in:
Orestis Floros
2021-02-13 21:03:16 +01:00
committed by GitHub
parent 79d8cb64b7
commit 0155fb60ba

View File

@@ -10,10 +10,6 @@
`read -a {{array}}` `read -a {{array}}`
- Enable backspace and GNU readline hotkeys when entering input with read:
`read -e {{variable}}`
- Specify the number of maximum characters to be read: - Specify the number of maximum characters to be read:
`read -n {{character_count}} {{variable}}` `read -n {{character_count}} {{variable}}`
@@ -33,3 +29,7 @@
- Do not echo typed characters (silent mode): - Do not echo typed characters (silent mode):
`read -s {{variable}}` `read -s {{variable}}`
- Read stdin and perform an action on every line:
`while read line; do echo "$line"; done`