I\'m trying to write a small script to change the current directory to my project directory:
#!/bin/bash cd /home/tree/projects/java
I save
You're doing nothing wrong! You've changed the directory, but only within the subshell that runs the script.
You can run the script in your current process with the "dot" command:
. proj
But I'd prefer Greg's suggestion to use an alias in this simple case.