From fd0bcd16816af623482a28042bded704fc203620 Mon Sep 17 00:00:00 2001 From: Cvetomird91 Date: Tue, 5 Jan 2016 23:47:20 +0200 Subject: [PATCH] added a page for the read builtin --- pages/common/read.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 pages/common/read.md diff --git a/pages/common/read.md b/pages/common/read.md new file mode 100644 index 000000000..27baa3015 --- /dev/null +++ b/pages/common/read.md @@ -0,0 +1,23 @@ +# read + +> BASH builtin for retrieving data from standard input + +- store data that you type from the keyboard + +`read {{variable}}` + +- store each of the next lines you enter as values of an 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 + +`read -n {{character_count}} {{variable}} + +- use a specific character as a delimiter instead of a new line + +`read -d {{delimiter}} {{variable}}