I have a set of tools which I need to pass parameters depending on the project I\'m working on. I\'d like to be able to automatically set a couple of environment variables based
This is not pretty, but you can use a combination of exported environment variables and the value of $PWD
.
For example:
export VAR1=prefix
export prefix${HOME////_}_foo=42
export prefix${HOME////_}_bar=blah
Then myscript
needs only to eval echo \${$VAR1${PWD////_}}
to get at the directory based value.