How do you use CDPATH?

john.urban urban at cbnewsl.att.com
Sat May 4 05:10:26 AEST 1991


In article <1991May2.203153.13842 at mnemosyne.cs.du.edu> jscott at isis.cs.du.edu (James Scott) writes:
>How do you use the environment variable CDPATH? I'm using
>both ATT SysV.3's sh and ntcsh version 5.12.
>Thanx,
>		James
>


Under the Bourne shell here's a little example .....

$ CDPATH=:/:/usr	# <-Just like PATH, look in . first, then / then /usr
$ export CDPATH
$ cd /usr		
$ cd bin		# <- finds bin under . so go there.
$ pwd
/usr/bin
$ cd bin		# <- does not find bin under . so now search for first
			#    bin directory un the $CDPATH variable.
/bin			# <- automatically prints out where it found it.
$ pwd
/bin

Sincerely,

John Urban
att!garage!jbu



More information about the Comp.unix.questions mailing list