-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mon, 11 Nov 2002 08:55:41 +0100, Ronald Hermans wrote:

> I wrote a little script to change to an other directory:
> 
>       #!/bin/bash
>       cd /home/ronald/scripts
>       clear
>       ls -l *.sh
> 
> Everything goes allright except the fact that when the script is ended
> I'm still in /home/ronald and not in /home/ronald/scripts
> The scripts folder is in the PATH so I can call the script from any
> place.
> 
> What is going wrong?

Nothing. It is executed in a sub-shell. Instead, you could "source"
your script to execute it for your current shell, e.g. 

  $ source test.sh
or:
  $ . test.sh
  
- -- 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE9z7mk0iMVcrivHFQRApDvAJ9h0mDAijkP7KoQy9twkEjDx+pV9ACfUnVc
8c838bkoTBwO1x5Zp+3gASg=
=cq1C
-----END PGP SIGNATURE-----



-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@;redhat.com?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to