Skip to content

Instantly share code, notes, and snippets.

@pporada-gl
Last active January 17, 2017 17:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pporada-gl/c13f7798e842ffe03fcb086d48471f73 to your computer and use it in GitHub Desktop.
Save pporada-gl/c13f7798e842ffe03fcb086d48471f73 to your computer and use it in GitHub Desktop.
ENVIRONMENT="$1"
test_CNT="thing1 thing2 thing3"
beta_CNT="thing4 thing5 thing6"
for i in ${${ENVIRONMENT}_CNT}; do
echo $i
done
####
# Expected output
$ bash script.sh test
thing1
thing2
thing3
$ bash script.sh beta
thing4
thing5
thing6
# Actual output
script.sh: line 6: ${${ENVIRONMENT}_CNT}: bad substitution
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment