From owner-freebsd-bugs Mon Mar 10 21:11:58 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id VAA26816 for bugs-outgoing; Mon, 10 Mar 1997 21:11:58 -0800 (PST) Received: from fly.HiWAAY.net (root@fly.HiWAAY.net [208.147.154.56]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id VAA26809; Mon, 10 Mar 1997 21:11:51 -0800 (PST) Received: from bonsai.hiwaay.net by fly.HiWAAY.net; (8.8.4/1.1.8.2/21Sep95-1003PM) id XAA01308; Mon, 10 Mar 1997 23:11:36 -0600 (CST) Message-ID: <3324E961.41C67EA6@hiwaay.net> Date: Mon, 10 Mar 1997 23:10:57 -0600 From: Steve Price X-Mailer: Mozilla 3.01 (X11; I; FreeBSD 3.0-CURRENT i386) MIME-Version: 1.0 To: un_x@hotmail.com CC: FreeBSD-gnats-submit@freefall.freebsd.org, freebsd-bugs@freefall.freebsd.org Subject: Re: bin/2934: sh(1) has problems with $ENV References: <199703102355.AAA10899@uriah.heep.sax.de> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk steve howe wrote: > > >Number: 2934 > >Category: bin > >Synopsis: sh(1) has problems with $ENV > > /bin/sh in any FreeBSD system so far. > > >Description: > > /bin/sh processes $ENV fine if it has been set inside ~/.profile like: > > ENV=${HOME}/.env; export ENV > > However, it fails to source $ENV in this case: > > export ENV=${HOME}/.env > > >How-To-Repeat: > > 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. > I tried this and it didn't appear to work at first, but I believe it is because of this. steve[~]$ grep steve /etc/passwd steve:*:1000:1000:Steve Price:/home/steve:/bin/bash steve[~]$ echo $ENV /home/steve/.bashrc steve[~]$ cat /home/steve/.bashrc steve[~]$ cat /home/steve/.profile export ENV=${HOME}/env-stuff echo ~/.profile steve[~]$ cat /home/steve/env-stuff echo "Yep I'm here!" steve[~]$ sh \u[\w]\$ exit steve[~]$ But after I change my login shell to /bin/sh or do a export ENV=${HOME}/env-stuff. It works as suspected. It appears to be a problem in that ~/.bash_profile is getting sourced and ENV is picked up from there. The reason that this would matter is that ~/.profile (or ~/.bash_profile for bash's case) is only getting sourced when it is started as a login shell. So just typing 'sh' will not source ~/.profile, but will source $ENV (which was set by your login shell) if your euid == uid && egid == gid. Could this be the case with you as well? Steve > >Fix: > > Not known. > > >Audit-Trail: > >Unformatted: > [This PR sent by joerg on behalf of Steve who doesn't have a good > enough IP connectivity.]