How to cd in a bash script, and remian in that directory after the script stops executing

9 views
Skip to first unread message

Cappy2112

unread,
Apr 10, 2005, 2:26:25 AM4/10/05
to bash...@googlegroups.com

I've written a 2 line script which cd's to a rather long path, but when
the script finishes executing, I am back in the original directory
where I had started executing the script.

How do I make the script stay in the directory that I cd'd to, after
the script is over ?

thanks

Maxim Vexler

unread,
Apr 10, 2005, 7:13:03 AM4/10/05
to bash...@googlegroups.com
Well, you can try :

source ./<filename>

or the shortened version
. ./<filename>

for more info
$ help .

HTH
--
Cheers,
Maxim Vexler (hq4ever).

Do u GNU ?
Reply all
Reply to author
Forward
0 new messages