Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!paperboy!hsdndev!cmcl2!panix!eravin From: eravin@panix.uucp (Ed Ravin) Newsgroups: comp.unix.shell Subject: Re: Help with this script Summary: check out CDPATH in ksh Message-ID: <1991Apr10.154927.23360@panix.uucp> Date: 10 Apr 91 15:49:27 GMT Organization: Newsaholics Annonymous Lines: 34 If you've got ksh to play with, check out the CDPATH variable. This will let you select a list of directories to search when you say "cd foo". For example: $ CDPATH=".:/usr/mom:/usr/dad:/home" and then $ cd foo Will search, in order, for ./foo, /usr/mom/foo, /usr/dad/foo, /home/foo and whichever one it finds first it will cd to (and echo the directory name it chose). ksh also gives you built in pattern substitution on the cd command. So if your current directory is /usr/mom/foo/bar/rastafarian/lefthanded/mugglethworp And you say: $ cd rastafarian unitarian ksh will attempt to cd to: /usr/mom/foo/bar/unitarian/lefthanded/mugglethworp With all those features, if you can switch to ksh (or are already using it), you might not want to even bother with "ncd" emulation. -- Ed Ravin | This random number tells the computer that you are cmcl2!panix!eravin | a member in good standing. It is not related to your philabs!trintex!elr | membership number. --- Sierra Club