Help with this script

Hendrik te Winkel hendrik at cca.vu.nl
Thu Apr 11 00:01:53 AEST 1991


rgupta at leland.Stanford.EDU (Rajesh Gupta) writes:

>In article <1991Apr9.164257.9128 at agate.berkeley.edu> danabu at 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 <argument> -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.

Hendrik

-- 
handtekeningetje



More information about the Comp.unix.shell mailing list