From dd7ae08a3b4b538155bfc877067c307ee5e3a287 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Thu, 14 Jun 2018 21:02:16 +1000 Subject: [PATCH] docs: update --- README.md | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index c8ccc04..322572d 100644 --- a/README.md +++ b/README.md @@ -192,24 +192,14 @@ rstrip() { ```sh _() { - # First Example. + hello_world="test" + + # Create the variable name. var1="world" var2="hello_${var1}" - declare "${var2}=test_string" + + # Print the value of the variable name stored in 'hello_$var1'. printf '%s\n' "${!var2}" - - - # Second Example. - # Assign to a variable named after the - # value stored in '$var'. - var="test" - read -rp "input text: " "${var?}" - - # Access the variable indirectly. - printf '%s\n' "set var \$$var to '${!var}'" - - # Access the variable directly. - printf '%s\n' "set var \$$var to '$test'" } ```