From owner-freebsd-questions Sun May 14 14:16:22 2000 Delivered-To: freebsd-questions@freebsd.org Received: from ren.sasknow.com (ren.sasknow.com [207.195.92.131]) by hub.freebsd.org (Postfix) with ESMTP id E8CC937B8FA for ; Sun, 14 May 2000 14:16:16 -0700 (PDT) (envelope-from ryan@sasknow.com) Received: from localhost (ryan@localhost) by ren.sasknow.com (8.9.3/8.9.3) with ESMTP id PAA87098; Sun, 14 May 2000 15:17:02 -0600 (CST) (envelope-from ryan@sasknow.com) Date: Sun, 14 May 2000 15:17:02 -0600 (CST) From: Ryan Thompson To: Ben Smithurst Cc: Omachonu Ogali , XF , Alex Kwan Subject: Re: A basic question about C programming (sloved) In-Reply-To: <20000514152939.R10128@strontium.scientia.demon.co.uk> Message-ID: Organization: SaskNow Technologies [www.sasknow.com] MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Ben Smithurst wrote to Omachonu Ogali: > Omachonu Ogali wrote: > > > On Sun, 14 May 2000, XF wrote: > > > >> you have to give the PATH, > > export PATH="$PATH:." > > No. Live with typing "./" when you need to. Having "." in $PATH is > dumb (so I wasn't surprised to see one of the Linux distributions had it > like that by default). What happens when you mis-type a command when > you're in /tmp and someone has put a nasty script there? Amen to that, Ben. Adding the current directory to your $PATH IS a foolish thing to do. As a normal user, you can't damage much, but adding . to root's path is virtually suicide, as you have already pointed out. . in the path is arguably an MS-DOS thing to do, and it amounts to nothing more than convenience for the lazy. Users and administrators alike should avoid ambiguity and potential slips/security problems and explicitly specify ./ when executing commands in the current directory. Even with . at the end of your $PATH, you STILL need to specify ./ to execute recompiled versions of common commands that exist elsewhere in your path (or exist as builtin(1) commands). Suppose you patch a utility in /usr/src/usr.bin, recompile, and, having added . to the end of your $PATH, scratch your head and wonder why your patch didn't take effect when you simply type the command. One could go on for quite some time on this topic... I merely wanted to add my bit as further encouragement NOT to add . to any $PATH. Virtually yours, - Ryan -- Ryan Thompson Systems Administrator, Accounts Phone: +1 (306) 664-1161 SaskNow Technologies http://www.sasknow.com #106-380 3120 8th St E Saskatoon, SK S7H 0W2 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message