Date: Fri, 14 Mar 1997 09:02:22 -0800 (PST) From: " steve howe" <un_x@hotmail.com> To: sprice@hiwaay.net Cc: FreeBSD-gnats-submit@freefall.freebsd.org, freebsd-bugs@freefall.freebsd.org Subject: Re: bin/2934: sh(1) has problems with $ENV Message-ID: <199703141702.JAA25704@f5.hotmail.com>
index | next in thread | raw e-mail
>Date: Mon, 10 Mar 1997 23:10:57 -0600
>From: Steve Price
>To: un_x@hotmail.com
>CC: FreeBSD-gnats-submit@freefall.freebsd.org,
>Subject: Re: bin/2934: sh(1) has problems with $ENV
>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?
>
i'm not sure exactly what you want to know from me - but i am only
using "sh" - no other shells.
>
>>
>> Not known.
>>
>> >Audit-Trail:
>> >Unformatted:
>> [This PR sent by joerg on behalf of Steve who doesn't have a good
>> enough IP connectivity.]
>
---------------------------------------------------------
Get Your *Web-Based* Free Email at http://www.hotmail.com
---------------------------------------------------------
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199703141702.JAA25704>
