Search This Blog

Sunday, April 24, 2011

How to change directory using shell script

If you want to change the directory using a shell script (like a bookmark), you need to invoke the script with source, or put a "." to run your script. e.g.

#myscript.sh
cd ~/source/myproject                                                      
export PYTHONPATH=$PWD/lib   



to run it, with:
source myscript.sh
or
. myscript.sh

No comments: