Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!think.com!snorkelwacker.mit.edu!stanford.edu!leland.Stanford.EDU!rgupta From: rgupta@leland.Stanford.EDU (Rajesh Gupta) Newsgroups: comp.unix.shell Subject: Re: Help with this script Message-ID: <1991Apr10.235620.3302@leland.Stanford.EDU> Date: 10 Apr 91 23:56:20 GMT References: <1991Apr9.164257.9128@agate.berkeley.edu> <1991Apr9.175008.12044@leland.Stanford.EDU> <1991Apr10.140153.480@cca.vu.nl> Organization: Computer Systems Laboratory, Stanford University Lines: 32 In article <1991Apr10.140153.480@cca.vu.nl> hendrik@cca.vu.nl (Hendrik te Winkel) writes: >rgupta@leland.Stanford.EDU (Rajesh Gupta) writes: > >>In article <1991Apr9.164257.9128@agate.berkeley.edu> danabu@garnet.berkeley.edu (Daniel N. Abushanab) writes: >>> >>>Hi, >>>I'm trying to write a script to emulate the DOS Norton Utilities "ncd" ... > > >>How about: > >> cd `find . -name -type d -print` >>This should do the job. > >Not really, again when you put this into a file it will change your >directory but after the filescript finishes you'll discover >that you are again in the original directory. >Of course you could alias it in csh. >But now some real answer from a guru please! Is it really impossible >to change your working dir with a shell script _and_ to remain there >after it is finished? I don't know how to do it. Please inform. no it is not possible. When running the shell as a child process, the parent environment can not be changed by the child with pre-meditation on part of the parent. Rajesh Gupta rgupta@sirius.stanford.edu