-
-
Save awaxa/c970c05feb47f40976cea987d409ebdf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ENVIRONMENT="$1" | |
test_CNT="thing1 thing2 thing3" | |
beta_CNT="thing4 thing5 thing6" | |
varname=${ENVIRONMENT}_CNT | |
for i in ${!varname}; do | |
echo $i | |
done | |
#### | |
# Expected output | |
$ bash script.sh test | |
thing1 | |
thing2 | |
thing3 | |
$ bash script.sh beta | |
thing4 | |
thing5 | |
thing6 | |
# Actual output | |
(as expected) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Really really fucking cool