Reputation: 11266
Nested variables have prevented me from trying to use BASH more extensively... consider the following:
export SYS_DIR='/home/${LOGNAME}/sys'
export APP_DIR='${SYS_DIR}/app'
I always end up with
> set
APP_DIR=/home/${LOGNAME}/sys/app
why? lol
and how do I get what I want =/
I'm not trying to resolve ${${var}}, but rather actual strings as shown above
Upvotes: 3
Views: 2212
Reputation: 49156
Use double quotes
export APP_DIR="${SYS_DIR}/app"
Single quotes treat everything inside as literal, not evaluated.
Upvotes: 10