Marek Habersack <[EMAIL PROTECTED]> writes: > [1 <text/plain; us-ascii (quoted-printable)>] > * Philip Hands said: > > Wait a second. > > > > So this mc script is an attempt to leave you in the directory you were > > in when you left mc ? > [snip] > > /etc > > /tmp > > > > the ``cd /etc'' only applies in the shell executed in the brackets. > > The same goes for the mc script. Any effect of the cd in the script is > > lost when the script exits. > Correct. My typo - it should be: > > cd $(cat thetmpfile)
Eh ? It doesn't matter how you provide the directory name to the cd, because wherever you cd to only persists to the end of the wrapper script, so it's not going to do you any good anyway. Please try to pay attention. To demonstrate: palm:~$ echo -e '#!/bin/bash\ncd /' > /tmp/cd_to_root palm:~$ chmod +x /tmp/cd_to_root palm:~$ pwd /home/phil palm:~$ /tmp/cd_to_root palm:~$ pwd /home/phil See? Cheers, Phil.