This is a .bashrc question.
I would like to set "export FOO=bar" for .bashrc in a particular directory like .rvmrc.
I tried below.
$ touch ~/foo/.bashrc
$ echo 'export RAILS_ENV=development' >> ~/foo/.bashrc
$ cd foo/
$ env|grep RAILS_ENV
But RAILS_ENV shall be set nothing in this case.
If I set onto .rvmrc instead of .bashrc, it pass! But it is better way to set onto .bashrc because I do not need to install rvm environment.
Any solutions?
in your bashrc set this:
The contents of the PROMPT_COMMAND variable will be executed every time your prompt is rewritten ( just before it’s written actually ) the command above checks the $PWD variable ( which holds the current working directory of your shell ) against “/foo/bar” if it matches it exports your variable if it doesn’t then the variable is unset.
EG