docs: update
This commit is contained in:
10
README.md
10
README.md
@@ -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"
|
||||||
|
|||||||
Reference in New Issue
Block a user