PATH, was: Re: [OS X TeX] OT: Autotrace

Martin Costabel costabel at wanadoo.fr
Mon Mar 19 09:20:38 CET 2007


Gerben Wierda wrote:
> On Mar 18, 2007, at 19:53 , Roussanka Loukanova wrote:
> 
>> Hi,
>>
>> I have a marginally related question about setting up the PATH 
>> variable for accessing scripts defined by the user. Which is the good 
>> way to add the user's ~/bin directory to the search path: at its 
>> beginning or end, e.g. by adding a resepctive line in .bashrc
>>
>> (1) export PATH=$HOME/bin:$PATH
>>
>> (2) export PATH=$PATH:$HOME/bin
> 
> I prefer 2. It is safer because you cannot (accidentally, or 
> maliciously) override system stuff. Name clashs are also esier to 
> resolve as you can change the name of your personal script while it is 
> not advisable to change the names of system stuff.

There are times when you want or need to override system stuff.

There is a reason why the order of precedence usually is:
User's personal stuff, then systemwide user-installed stuff, then system 
stuff.

This is true in the NextStep parts of MacOSX:
~/Library takes precedence over /Library which takes precedence over 
/System/Library.

And it is true in the traditional Unix parts of MacOSX:
/usr/local/lib takes precedence over /usr/lib, and /usr/local/bin comes 
before /usr/bin. Traditionally and logically, ~/bin comes before 
/usr/local/bin. Have a look at the file /usr/share/tcsh/examples/login 
which shows a traditional tcsh setup.

It is true that there may be security concerns, but they are minimal in 
comparison with the problems that /usr/local/bin often causes. Whereas 
any odd 3rd-party software that you download, install and then forget 
places stuff into /usr/local/bin, usually nobody else than the user puts 
things into ~/bin.

-- 
Martin


------------------------- Helpful Info -------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/





More information about the macostex-archives mailing list