On Saturday 12 November 2011, Jim Meyering wrote: > > Thanks for the suggestion. > I was leaning towards accepting it, but then checked... > > When /bin/sh is a link to bash, that envvar is not set here (F16): > Because it's not an environment variable, but only a shell variable :-) Which makes sense, as otherwise all the shells invoked by bash could be too easily mistaken for bash shells *shudder*
> $ env -i sh -c env > PWD=/h/j/w/co/grep > SHLVL=1 > _=/bin/env > I can obtain, on my Debian box: $ env -i /bin/sh -c 'env' PWD=/devel/stefano/src/am/branches/trunks SHLVL=1 _=/usr/bin/env $ env -i /bin/sh -c 'echo "$BASH_VERSION"' 4.1.5(1)-release all as expected IMO. I guess the sae would happen on every sane system out there. Regards, Stefano
