Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!udel!haven!umbc3.umbc.edu!math13.math.umbc.edu!rouben From: rouben@math13.math.umbc.edu (Rouben Rostamian) Newsgroups: comp.unix.shell Subject: Re: Help with this script Message-ID: <1991Apr9.181929.6808@umbc3.umbc.edu> Date: 9 Apr 91 18:19:29 GMT References: <1991Apr9.164257.9128@agate.berkeley.edu> Sender: newspost@umbc3.umbc.edu (News posting account) Reply-To: rouben@math13.math.umbc.edu.UUCP (Rouben Rostamian) Organization: Mathematics Department University of Maryland, Baltimore County Lines: 25 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. > >[Shell script deleted]: > Try cd `find . -name 'pattern' -type d -print'` where "pattern" is a directory name, possibly incuding wildcards. -- Rouben Rostamian Telephone: (301) 455-2458 Department of Mathematics and Statistics e-mail: University of Maryland Baltimore County bitnet: rostamian@umbc.bitnet Baltimore, MD 21228, U.S.A. internet: rouben@math9.math.umbc.edu