On 12/1/16 2:35 PM, Vladimir Marek wrote:
> Hi,
> 
> during testing of latest bash on Solaris I found strange behavior. We
> run the tests with clear environment (env -). It seems to be caused by
> undefined SHELL variable. The test reported
> 
> 150,151c150,151
> < ./redir11.sub: line 26: echo: write error: Bad file number
> < ./redir11.sub: line 27: echo: write error: Bad file number
> ---
>> ./redir11.sub: line 26: $(a=4 foo): Bad file number
>> ./redir11.sub: line 27: $(a=4 foo): Bad file number
I can't reproduce this.  The key is that redir11.sub inherits file
descriptor 3 as an fd open for read on /etc/passwd, and echo gets a
write error when trying to write to it.  This might also be affected
by SHELLOPTS setting posix mode, but I can't reproduce it even when
setting SHELLOPTS=posix in the environment.

It's also hard to see why starting bash  without SHELL in the environment
sould make such a difference, since bash sets SHELL to the current user's
login shell, as found via getpwent.

Chet


-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    c...@case.edu    http://cnswww.cns.cwru.edu/~chet/

Reply via email to