[comp.sources.d] "unportable" shar scripts

rsalz@bbn.com (Rich Salz) (10/29/87)

Someone complained about seeing
	PATH=/bin:/usr/bin:/usr/ucb ; export PATH
in shar scripts, particularly calling out comp.sources.unix.  He asks if
it's a standard shar that's doing this, and would prefer to see
	PATH=/bin:/usr/bin:/usr/ucb:$PATH ; export PATH

Disclaimer:  I'm the moderator of comp.sources.unix, and I wrote a set of
shar/unshar/makekit tools that lots of people seem to be using (tell-tale
clue:  if the script has a "-c" trick it's my stuff).  I am very concerned
and aware of the distribution problems and mechanisms behind wide-spread
source publication (i.e., "I've gotten more BITNET failure messages than
you have!" :-)

I claim that for a shell script to really be portable, it had better use
only programs found in /bin or /usr/bin.  I haven't seen any scripts that
particularly needed /usr/ucb, but I don't see the harm.  Adding other
directories doesn't make any sense because they're too unstandard:  I've
seen /usr/local, /usr/local/bin, /usr/unsupported, and here we use
/usr/bbn a lot.  Prepending the existing PATH is wrong, because the whole
purpose is to get standard commands (I guarantee you that "/usr/bbn/ls -l"
doesn't look like any "ls -l" you're used to. :-)

In short, there's probably no benefit, and there's definitely no harm, so
what's the gripe?

And while I'm here, let me just point out that if people have comments or
opinions on comp.sources.unix, the best medium is direct email to me at
sources@uunet.uu.net; the odds of my seeing a public posting -- let alone
responding -- are pretty slim, trust me.
	/Rich $alz, moderator thereof
-- 
For comp.sources.unix stuff, mail to sources@uunet.uu.net.

allbery@ncoast.UUCP (Brandon Allbery) (11/05/87)

As quoted from <228@papaya.bbn.com> by rsalz@bbn.com (Rich Salz):
+---------------
| Someone complained about seeing
| 	PATH=/bin:/usr/bin:/usr/ucb ; export PATH
| in shar scripts, particularly calling out comp.sources.unix.  He asks if
| it's a standard shar that's doing this, and would prefer to see
| 	PATH=/bin:/usr/bin:/usr/ucb:$PATH ; export PATH
+---------------

On ncoast, I install bugfixed programs in /u/local and chmod -x the original
in order to insure that an upgrade of the OS which doesn't fix the buggy
program doesn't lose the fixed version.  (Case in point: lorder.)  While I
admit that most shar scripts don't run lorder, what would happen if our
version of some commonly-used program (i.e. sed) were to reveal a bug, and
I placed a fixed version in /u/local?  (Not that I could in that case, as we
aren't a source site and rewriting sed from scratch doesn't appeal.)
-- 
Brandon S. Allbery		     necntc!ncoast!allbery@harvard.harvard.edu
 {harvard!necntc,well!hoptoad,sun!mandrill!hal,uunet!hnsurg3}!ncoast!allbery