> **Possible Duplicate:** > [Execute bash scripts on entering a directory](http://unix.stackexchange.com/questions/21363/execute-bash-scripts-on-entering-a-directory) <!-- End of automatically inserted text --> 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?