Possible Duplicate:changing current working dir with a script I am trying to create few scripts that would change the working directory of the main shell/terminal. Not able to do so. I tried the followingFile p1.sh#!/bin/bashcd /home/mtk/work/project1File code.sh#!/bin/bashcd /home/mtk/templates/resusable/sampleCodesBut I am aware that the above would change it only for itself i.e. the one running currently, which would be p1.sh or code.sh in this case.Please let me know, how would I be able to change the current working directory for the parent calling shell.Example Run and expectation:$ pwd/home/mtk$ p1.sh$ pwd/home/mtk    ### --> Expected /home/mtk/work/project1NoteMy use case is: I would like to do some processing and then place the prompt to a pre-defined directory.EDITI see why it would not work. And alias seems to be the solution for such case. But I would like to expand, my question:I need to create a script that would change the working dir of the parent shell dynamically. The script will be say mycd.sh . It would have command line arguments as mycd.sh -c/-p1/-p2/ or some other user defined arguments.Giving -c would switch the shell working dir to the respective dir. File mycd.sh would look like.. some processing# parameter parsingif [ $param1 -eq c ]; then    # change working dir of parent hereelse ... other conditionsI guess, there must be some way to change the shell working directory.Please let me know, if anything is not clear.
How to change the working directory of invoking shell using a script?
shell;shell script;directory;cd command