Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!linac!att!cbnews!cbnewsl!urban From: urban@cbnewsl.att.com (john.urban) Newsgroups: comp.unix.questions Subject: Re: How do you use CDPATH? Message-ID: <1991May3.191026.15548@cbnewsl.att.com> Date: 3 May 91 19:10:26 GMT References: <1991May2.203153.13842@mnemosyne.cs.du.edu> Distribution: na Organization: AT&T Bell Laboratories Lines: 26 In article <1991May2.203153.13842@mnemosyne.cs.du.edu> jscott@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