1

I define two variables in a shell script

RELEASE_TYPE="release"
CERT_TYPE="Prod"

and then I want to use it in something like this:

-l somepath/$RELEASE_TYPE/AndroidTZ1_4/tz-$CERT_TYPE
/something_release_Prod_non_relocatable.lib

As you can see, I use $RELEASE_TYPE and $CERT_TYPE when there's a trailing forward slash, but how can I use these vars also on the last bit, i.e. /something_$RELEASE_TYPE_$CERT_TYPE_non_relocatable.lib? If I do that, the vars are not evaluated at all, i.e. I end up with something_ and none of the rest. Also tried with + and other chars, nothing gets me what I expected.

Any ideas? Thanks!

John Kugelman
  • 349,597
  • 67
  • 533
  • 578
ranshe
  • 67
  • 7
  • possible duplicate of [bash: Why do we need curly braces in variables?](http://stackoverflow.com/questions/8748831/bash-why-do-we-need-curly-braces-in-variables) – Barmar Oct 18 '14 at 00:13

1 Answers1

1

Surround the variable names with curly braces.

/something_${RELEASE_TYPE}_${CERT_TYPE}_non_relocatable.lib
John Kugelman
  • 349,597
  • 67
  • 533
  • 578