From 0155fb60babf4f1016647e33161c750cfa2b3c47 Mon Sep 17 00:00:00 2001 From: Orestis Floros Date: Sat, 13 Feb 2021 21:03:16 +0100 Subject: [PATCH] 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. --- pages/common/read.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pages/common/read.md b/pages/common/read.md index b05cd19f6b..84f9656758 100644 --- a/pages/common/read.md +++ b/pages/common/read.md @@ -10,10 +10,6 @@ `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: `read -n {{character_count}} {{variable}}` @@ -33,3 +29,7 @@ - Do not echo typed characters (silent mode): `read -s {{variable}}` + +- Read stdin and perform an action on every line: + +`while read line; do echo "$line"; done`