tech-userlevel archive

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

Re: /bin/sh redirection in 'while' loop not closed afterwards?

On Mon, Sep 26, 2011 at 02:28:15PM +0200, Anthony Mallet wrote:
> Hi,
> I observe this strange behaviour with /bin/sh on NetBSD-5.1 and current. It
> seems that the redirection for the 'while' loop (fd 9 below) is not closed 
> once
> the loop finishes:

At a guess the fd for redirection usually get opened, duped above 10, then
duped to the required number very late on (in the child).

The redirect on a while loop (or any other builtin) forces a subshell
so something is probably suspect in that subshell path.


David Laight:

Home | Main Index | Thread Index | Old Index