Help with this script

Bruce Varney asg at sage.cc.purdue.edu
Thu Apr 11 08:21:14 AEST 1991


In article <1991Apr10.154927.23360 at panix.uucp> eravin at 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 at sage.cc.purdue.edu             ###    #####       #
PUCC                               ###                #
;-)                                 #                #
;'>                                #               ##



More information about the Comp.unix.shell mailing list