[Gllug] Why does this script not work?

Vincent AE Scott gllug at codex.net
Mon Dec 10 10:36:05 UTC 2001


Colin Murphy(colin at ql4ever.demon.co.uk)@Mon, Dec 10, 2001 at 10:16:42AM +0000:
> I want a script that will change my current working directory to the 
> path above, the same as 'cd ..'.
> 
> 
> #!/bin/bash
> pwd
> cd ..
> pwd
> 
> does what I would expect
> 
> [colin at second gllug]$ ../cdscript.sh
> /home/colin/gllug
> /home/colin
> 
> but doesn't 'set' the directory once the script exits.
> 
> How do I set my current directory to that set in the script.

append :
exec /bin/bash

is one option.

-- 

PGP key:  http://codex.net/pgp/pgp.asc

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list