bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problem with redir test


From: Chet Ramey
Subject: Re: problem with redir test
Date: Thu, 1 Dec 2016 16:47:52 -0800
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.5.0

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    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]