Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at> writes:
> David G. Johnston wrote:
>> Except you haven't recreated the scenario I presented.
> Am I missing something?
I wonder what platform David is using. This looks suspiciously like
a feature that macOS' SIP would be designed to break.
It would be interesting to capture the output of "env" in the sub-shell
to see which environment variables and functions are getting through.
regards, tom lane