Reputation: 342
I'm a bash newb; just curious if this is possible...
assume i have ~/.bash_profile (mac terminal) w/ following declarations:
export src=~/Developer/src
export myapp=$src/myapp
alias buildapp='build $myapp' # just an example...
this gets loaded when i start up the terminal, and everything's fine.
what i want to do is, later when i switch to a different branch/depot/whatever, i want to type,
export src=~/Developer/temp_src
in the shell, and make $myapp automatically reference the new $src variable...
is this actually possible?
Upvotes: 1
Views: 56
Reputation: 785058
Don't create myapp
variable and just use this alias:
alias buildapp='build "$src/myapp"'
Having said that, it is usually better to use a function instead of alias
:
buildapp() { build "$src/myapp"; }
Upvotes: 2