Re:Unix Recovery Legend (1986)
by Someone1234 on Wednesday September 02, 2015 @03:40PM
(#10161464)
Those examples are trying to change the directory on the shell's child process, not on the shell itself.
That being said, aside from a kernel patch there is definitely no official way of doing it. This is the hacky way:
http://stackoverflow.com/questions/2375003/how-do-i-set-the-...
python -c 'import os; os.chdir("/")'
Notice that the working directory of your shell is unaffected. :-)
Or:
bash -c 'export foo=bar'; echo $foo