From owner-freebsd-questions Thu Nov 9 12:49:14 2000 Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (okc-27-149-77.mmcable.com [24.27.149.77]) by hub.freebsd.org (Postfix) with SMTP id 1F81537B4C5 for ; Thu, 9 Nov 2000 12:49:12 -0800 (PST) Received: (qmail 24932 invoked by uid 100); 9 Nov 2000 20:49:11 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14859.3527.407826.940938@guru.mired.org> Date: Thu, 9 Nov 2000 14:49:11 -0600 (CST) To: Peter Cc: questions@freebsd.org Subject: Re: your mail In-Reply-To: <64974940@toto.iv> X-Mailer: VM 6.75 under 21.1 (patch 10) "Capitol Reef" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Peter types: > > > You can add "." to your path by changing your shell rc file to > > > include the line PATH=$PATH:. > just add $PWD to your path so you don't have to type ./command everytime, > I'm not sure how adding a . to your path works, is that the same as $PWD ? "." is another name for the current directory. $PWD is a variable that expands to the path of the current directory when it is evaluated. So in your path, "." always looks in the shells current directory when you issue a command. "$PWD" always looks in what the shells current directory was when you added it to PATH. That's still not very clear, so here's an example: /tmp/a1$ PATH=$PATH:$PWD |/tmp/a1$ PATH=$PATH:. /tmp/a1$ ls |/tmp/a1$ ls foo |foo /tmp/a1$ foo |/tmp/a1$ foo | /tmp/a1$ cd /tmp/a2 |/tmp/a1$ cd /tmp/a2 /tmp/a2$ ls |/tmp/a2$ ls bar |bar /tmp/a2$ foo |/tmp/a2$ foo |foo: Command not found. /tmp/a2$ bar |/tmp/a2$ bar bar: Command not found. | The critical thing is the last bit: not which directory the found vs. not found commands are in. Final note, "." is considered to be a security problem. If you're going to add it, make sure it's the *last* thing in your path. That minimizes those problems.