On Fri, 13 Jul 2007, Philip Guenther wrote:

> On 7/13/07, Denny White <[EMAIL PROTECTED]> wrote:
> ...
> > PATH=$HOME/bin:$HOME:/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/bin:/usr/local/sbin:.
> 
> That line is probably unnecessary.  Unless you can point to a specific
> program that your .procmailrc uses that is not in the default PATH set
> by procmail, why change it?
> 
> 
> > FORMAIL=/usr/local/bin/formail
> 
> Why do people think that hardcoding the paths to normal programs is a
> good thing?  Why not just say "formail" and let the shell do the work?

Sometimes users do nutty things with aliases.  Then they need to
undo the nuttiness when they need default behavior.  Even worse is
the sort who defines new meanings for common commands and places
them "high" in the PATH, or defining nutty shell functions named
for standard commands. (Such as the nutty implementation of "undelete"
functionality through a redefinition of rm to a mv of a file to a
"hidden" directory.)

The default ksh.kshrc shipped with OpenBSD contains "nutty" aliases:

alias su=wsu
alias cd=wcd
alias ftp=wftp
alias ssh=wssh
alias telnet=wtelnet
alias rlogin=wrlogin
alias ls='ls -gCF'

wxxx are nutty shell functions, given the best of both kinds
of nuttiness.

Once this nuttiness is invited in, the author of shell scripts and
configuration files becomes justifiably nervous about their scope.
On a multiuser system, even one with one human user, uncertainty
arises about what flavor of nuttiness is in play for each user in
all possible contexts.  (Is my user name that invokes ksh subject
to the same nuttiness as the one that invokes zsh or csh?)

Also, slipping a dubious substitution for a system command into
another user's ~/bin, on ill-administered or "trusty" systems, can
lead to various forms of good-natured, puckish mischief.  (Suppose
I can substitute an arbitary executable named "vi" or "rm" into
your ~/bin.)

Setting a PATH and using fully qualified path names for utilities
may be classified as a sort of prudent practice.  Whether it is
best practice I do not judge.

Dave

Reply via email to