pure-bash-bible/manuscript/chapter6.txt

18 lines
271 B
Plaintext

# Variables
## Assign and access a variable using a variable
```shell
hello_world="test"
# Create the variable name.
var1="world"
var2="hello_${var1}"
# Print the value of the variable name stored in 'hello_$var1'.
printf '%s\n' "${!var2}"
```
<!-- CHAPTER END -->