On `linux` using `bash`,  

lets say I made two programs both called `print_report`.  

(They are in different directories.) 

Inside my `.bashrc` file, I have: 

> 
> PATH="path/to/print\_report1/:$PATH" 
> 
> 
> 

This allows me to type `print_report` anywhere and it will run one of the programs. 

---

**How can I have bash decide to use one or the other depending on the working directory?** 

for example,  

If I'm currently in `~/project1/` and type `print_report` it will use `/bin/foo/print_report`  

If I'm currently in `~/project2/` and type `print_report` it will use `/bin/bar/print_report`