[Top][All Lists]

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

Re: moving fd affect outer scope

From: Chet Ramey
Subject: Re: moving fd affect outer scope
Date: Tue, 19 Feb 2013 09:48:57 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130107 Thunderbird/17.0.2

On 2/18/13 2:55 PM, Stephane Chazelas wrote:

> Bash Version: 4.2
> Patch Level: 37
> Release Status: release
> Moving a file descriptor for a builtin command or a compound
> command leaves the fd closed afterwards:
> $ bash -c ': <&1-; echo test'
> bash: line 0: echo: write error: Bad file descriptor
> expected output: "test".

Thanks for the report.  This has probably been around for as long as those
redirections have been around -- at least 10 years.  I've attached a patch
to fix it.


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

Attachment: redir-fd-move.patch
Description: Source code patch

reply via email to

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