Date: Tue, 11 Mar 1997 01:40:03 -0800 (PST) From: Stephen McKay <syssgm@devetir.qld.gov.au> To: freebsd-bugs Subject: Re: bin/2934: sh(1) has problems with $ENV Message-ID: <199703110940.BAA09613@freefall.freebsd.org>
index | next in thread | raw e-mail
The following reply was made to PR bin/2934; it has been noted by GNATS.
From: Stephen McKay <syssgm@devetir.qld.gov.au>
To: Steve Price <sprice@HiWAAY.net>
Cc: freebsd-gnats-submit@freebsd.org, syssgm@devetir.qld.gov.au
Subject: Re: bin/2934: sh(1) has problems with $ENV
Date: Tue, 11 Mar 1997 19:12:28 +1000 (EST)
Steve Price <sprice@HiWAAY.net> wrote:
> steve howe wrote:
> >
> > Use:
> > export ENV=${HOME}/.env
> >
> > in your ~/.profile, and re-invoke another level of sh(1). $ENV won't
> > be read. Now invoke any other Bourne-alike shell (pdksh, ksh93,
> > bash), it will process $ENV correctly.
> >
[Description of confusion between bash use of $ENV and sh use of $ENV elided.]
> Could this be the case with you as well?
Well my view on this is that $ENV processing in /bin/sh is a dumbass idea,
and should be expunged immediately. Is it mandated by POSIX? Then send
them a rude letter and delete it anyway.
Is $ENV there to scare off the last few people who use the shell for scripts?
It's a perl plot, right? "We will trick those foolish sh users! Ha! Ha!
Just look at what we can do to them now:"
$ cat silly-bits
echo "Hello from ENV processing"
echo "This is where people put stupid things that break system scripts"
ls() { /bin/ls -sF $*; }
$
$ export ENV=`pwd`/silly-bits
$
$ cat serious-prog
#! /bin/sh
PATH=/bin:/usr/bin
echo "This had better be formatted correctly, or things will break!"
ls s*
$
$ ./serious-prog
Hello from ENV processing
This is where people put stupid things that break system scripts
This had better be formatted correctly, or things will break!
1 serious-prog* 1 silly-bits
$
Ouch! What can you depend on any more, even with PATH set? It's become
that much harder to write shell scripts.
Oh, and while you're deleting $ENV processing, I'm pretty unhappy with /bin/sh
being bloated with history editing. I'll be testing -DNO_HISTORY, and will
put that in my /etc/make.conf if it works.
Yours in frump,
Stephen.
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199703110940.BAA09613>
