diff options
author | dylan <dylan.araps@gmail.com> | 2020-07-16 15:36:47 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-16 15:36:47 +0300 |
commit | d744927f52a21dbcae182bf16cba82f73fbbf8d2 (patch) | |
tree | 0026740da719b8acac6be9734e4dc990e48b0e42 | |
parent | 70f410ebb2b0d54cab1b1d4db3804c654db9619a (diff) | |
parent | 9bcd730b6f98dd8396f780d047a41ecbe88f5619 (diff) | |
download | pure-sh-bible-d744927f52a21dbcae182bf16cba82f73fbbf8d2.tar.gz pure-sh-bible-d744927f52a21dbcae182bf16cba82f73fbbf8d2.zip |
Merge pull request #16 from FriendlyNeighborhoodShane/master
Dynamic variable naming magic
-rw-r--r-- | README.md | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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 ``` |