'cd' in shell-script or .profile

Doug Gwyn gwyn at smoke.BRL.MIL
Fri Jun 15 05:40:36 AEST 1990


In article <5672 at aplcen.apl.jhu.edu> trweil at aplcen.apl.jhu.edu (Weil Timothy Robert) writes:
>results were similar - a 'pwd' would indicate that I'd
>changed to the selected directory but UNIX kept me
>logged into $HOME....any other tricks to try?

A "cd" in a subprocess will not affect the CWD of an ancestral process.
However, your .profile is supposed to be executed in the context of the
login shell, so a "cd" there should work.  In fact, mine does it and it
works fine.



More information about the Comp.unix.questions mailing list