docs: update

This commit is contained in:
Dylan Araps
2018-06-14 14:36:57 +10:00
parent c0c62478fc
commit 7c2ed4de97

View File

@@ -163,6 +163,16 @@ rstrip() {
### Assign and access a variable using a variable. ### Assign and access a variable using a variable.
```sh ```sh
# First Example.
var1="world"
var2="hello_${var1}"
declare "${var2}=test_string"
printf '%s\n' "${!var2}"
# Second Example.
# Assign to a variable named after the # Assign to a variable named after the
# value stored in '$var'. # value stored in '$var'.
var="test" var="test"