[plug] Changing working directory from a bash script

Patrick Coleman blinken at gmail.com
Mon Jan 22 14:48:57 WST 2007


Hi all,

I realise that this seems pretty basic, but I'm trying to change the
working directory from within a bash shell script and not having much
luck.

Here's what I want to do:

restore3:~ admin$ ./somescript.sh
[script runs]
restore3:/some/directory admin$

I've tried cd from within the script, but that evidently doesn't work
because the script is executed in a subshell. I've also tried 'export
PWD=$dir' with no luck. Obviously both of these work when executed in
a normal shell, but not from a script.

Any suggestions would be much appreciated.

Cheers,

Patrick



More information about the plug mailing list