Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!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: <1991Apr9.175008.12044@leland.Stanford.EDU> Date: 9 Apr 91 17:50:08 GMT References: <1991Apr9.164257.9128@agate.berkeley.edu> Organization: Computer Systems Laboratory, Stanford University Lines: 27 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" >command. It should scan a directory tree file, find a directory that >matches a pattern inputted by the user, then exit. The following shell >accomplishes that job. Unfortunately, when the shell is exited it >returns the user to the directory from which it was called. Does anyone >have any idea about how to fix this? Any help is appreciated, please >respond by e-mail and I will post solution here. > ... How about: cd `find . -name -type d -print` This should do the job. Rajesh Gupta rgupta@sirius.stanford.edu