[Courses] [Perl] Part 1: Getting Started

Colleen Hatfield evilpig at gmail.com
Tue Apr 5 15:32:12 EST 2005


On Apr 4, 2005 11:40 PM, Sue Stones <suzo at spin.net.au> wrote:
 
> I like to put "." in my path, as the fist directory to look in, to solve
> the problem of having to type "./" before everything.  

Be very careful with this.  Having . in your PATH at all is insecure;
having it first is even worse.

The reason this is a problem is that it makes it very easy to execute
malicious code unintentionally.  For example, you might be browsing
around your system and ls a directory.  If a malicious user has put a
malicious program with the name "ls" in the directory that you execute
the ls command from, you've just executed it.  If you're the only
person that ever touches your machine, it's probably not too
dangerous; otherwise it should definitely be avoided. ;-)

Your other suggestion of creating a ~/bin/ directory is much safer
(though I'd still probably put it at the end of the path rather than
the beginning, unless you write programs with the same names as your
system executable files).

> Usually the path
> is set in your profile, but exactly where that is in OSX I don't know.

OS X is happily familiar in this area: /etc/profile is the system
profile, which has the default PATH info; you can override/add on to
this in your ~/.bash_profile or ~/.bashrc.

- Colleen


More information about the Courses mailing list