Setting $PATH for non-interactive uses

david <[email protected]> Wed, 18 Jan 2006 10:10:38 +0100
Newsgroups gmane.os.opendarwin.general
Message-ID <[email protected]>
I posted a similar questions in the Fink newsgroup. Since I haven't 
received any 'final' answer from the fink people and I also use DP I 
thought I could post it here as well:



The DP recommendations for setting $PATH when using tcsh are not 
'compatible' with Apple's recommendations about setting up tcsh. Apple 
has dedicated a special file, ~/Library/init/tcsh/path, to set $PATH but 
the DP recommendation at 
<http://darwinports.opendarwin.org/docs/ch01s03.html> is to use 
.(t)cshrc. What gives?

Furthermore, I believe this won't even work (I currently set my $PATH in 
~/Library/init/tcsh/login.mine but that is just because 
~/Library/init/tcsh/path didn't exist when I begun setting up my 
enviroment back in 10.1 or so) because in /usr/share/tcsh/login, that is 
read after .(t)cshrc, you'll find:

set path = (                                                    \
                ~/bin                                           \
                /usr/local/bin /usr/bin /bin                    \
                /usr/local/sbin /usr/sbin /sbin                 \
           )

As far as I can tell this resets $PATH.

However, there is a problem with setting $PATH the way I do too. For 
example, when I use rsync something like this

% rsync --rsh=ssh /aDirAt1stMachine 2ndMachine:/anotherDir

Similar problems apply to, among others, cron. I understand that you 
under ertain circumstances want a different envirnment with respect to, 
for example, $PATH when you use cron BUT generally I guess most people 
prefer to have the same enviroment for cron and regular interactive 
shells. At the end of the day cron is, most of the time, just postponed 
simple shell commands (which makes it different from shell scripts that 
might have quite advanced logic in their own).


Why ido you recommend DP-users to set it up like this? It doesn't make 
sense in my eyes.


Googling didn't come up with an explanation so I appreciate any input.