From 9547f8992c1d7751381e91d3807a1e4c4bf27bdb 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..7d995c7d5 --- /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}}