Possible Duplicate:
Execute bash scripts on entering a directoryExecute bash scripts on entering a directory
I am running an environment which requires some very specific tool versions. The commands to set up the environment are in a script called set_foo_env.sh
Suppose I have a directory ~/repository/foo/. Is is possible to run set_foo_env.sh as soon as I enter the foo directory?