Merge pull request #16 from FriendlyNeighborhoodShane/master

Dynamic variable naming magic
This commit is contained in:
dylan 2020-07-16 15:36:47 +03:00 committed by GitHub
commit d744927f52
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -677,12 +677,12 @@ done
# VARIABLES
## Name a variable based on another variable
## Name and access a variable based on another variable
```shell
$ var="world"
$ export "hello_$var=value"
$ printf '%s\n' "$hello_world"
$ eval "hello_$var=value"
$ eval printf '%s\n' "\$hello_$var"
value
```