Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!spool.mu.edu!news.nd.edu!mentor.cc.purdue.edu!sage.cc.purdue.edu!asg From: asg@sage.cc.purdue.edu (Bruce Varney) Newsgroups: comp.unix.shell Subject: Re: Help with this script Message-ID: <10053@mentor.cc.purdue.edu> Date: 10 Apr 91 22:21:14 GMT References: <1991Apr10.154927.23360@panix.uucp> Sender: news@mentor.cc.purdue.edu Reply-To: asg@sage.cc.purdue.edu (Bruce Varney) Organization: Purdue University Lines: 35 In article <1991Apr10.154927.23360@panix.uucp> eravin@panix.uucp (Ed Ravin) writes: }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". EVERY DAMN SHELL HAS CDPATH!!! although for csh and tcsh the syntax is set cdpath (. /usr/mom /usr/dad /homw) } }$ 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). } Course there is also th cdable_vars variable in bash. When it is set you can do: cdable_vars=on src=$HOME/etc/src then when you do $ cd src it will look for src in your CDPATH. i.e. ./src, /usr/mom/src. /usr/dad/src and /home/src. If none of these exist, it will then cd to $src This is useful IMHO The Grand Master --------- ### ## Courtesy of Bruce Varney ### # aka -> The Grand Master # asg@sage.cc.purdue.edu ### ##### # PUCC ### # ;-) # # ;'> # ##