Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 May 2020 13:49:19 +0200
From:      Ede Wolf <listac@nebelschwaden.de>
To:        freebsd-questions@freebsd.org
Subject:   Re: Moving sources (base/ports) from /usr
Message-ID:  <c7cd6f22-6d6f-9b3a-919e-24972a0f26c1@nebelschwaden.de>
In-Reply-To: <0b98639e-e714-412c-950e-7d20be5d1147@hedeland.org>
References:  <8d48921e-7af1-9313-0781-4ba4bd9c1f10@nebelschwaden.de> <ee6f9d59-9ac3-5d1e-baec-405fc1b24ab2@nebelschwaden.de> <20200520110833.f47610a48f0f28dd563c13aa@sohara.org> <2c3bd26c-aaa3-9998-e5e5-e3f4f3796ffc@nebelschwaden.de> <0b98639e-e714-412c-950e-7d20be5d1147@hedeland.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Sometimes, being pedantic helps quite a bit:

... (fresh login)
# echo $SOURCEDIR
/clutter/src
# env | grep SOURCEDIR
#
# SOURCEDIR="/clutter/src"
# export SOURCEDIR
# env | grep SOURCEDIR
SOURCEDIR=/clutter/src

Even if this distinction is currently raising more question than it 
answers, it at least explains the behaviour.

And I know I need to rethink my understanding of shell vs. environment 
variables (and the corresponding files).

Thanks for the heads up, with that in mind I'll reread the comment on 
sh(1) and .shrc from before and, well, have a talk with my favourite 
search enginge.



Am 20.05.20 um 13:31 schrieb Per Hedeland:
> On 2020-05-20 13:17, Ede Wolf wrote:
>> My bad. Very sorry. I totally forgot to mention, that root has changed it's login shell to /bin/sh. I do not use csh at all.
>>
>> So /etc/profile is being read and the SOURCEDIR is a valid environmental variable, as can be seen from the first echo $SOURCEDIR.
> 
> To be pedantic, 'echo $SOURCEDIR' does *not* show that SOURCEDIR is
> set in the *environment*, only that it is set in the shell *or* the
> environment. You might want to double-check with
> 
> $ env | grep SOURCEDIR
> 
>> It somehow does just not get handed down to mergemaster - unless exported again on the command line.
>>
>> I'll have a more in depth read through the explanation of Polytropon and sh(1) and certainly will give that a go. Very likely mergemaster calls it's own /bin/sh and that would then require the .shrc.
>>
>> Even though I still maintain, an export in [.]profile should be handed down to every subshell, unless overwritten. But I'm afraid, stubborness does not get me any further, unfortunately.
> 
> Leaving the vagaries of different shells and their rc files aside, I'd
> say that "*a variable set in the environment* should be handed down to
> every *subprocess*, unless overwritten (or explicitly excluded)".
> 
> --Per Hedeland
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
> 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?c7cd6f22-6d6f-9b3a-919e-24972a0f26c1>