bug-bash
[Top][All Lists]
Advanced

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

Re: Leak in BASH "named" file descriptors?


From: Pierre Gaston
Subject: Re: Leak in BASH "named" file descriptors?
Date: Wed, 13 Apr 2016 16:34:32 +0300



On Wed, Apr 13, 2016 at 3:51 PM, Chet Ramey <chet.ramey@case.edu> wrote:
On 4/13/16 1:54 AM, George Caswell wrote:

> Personally, I don't think it makes sense for a redirection on a command to
> persist beyond the scope of that command. A redirection with a
> dynamically-assigned fd is basically equivalent to a redirection to a
> numbered fd.

Then why have it?  There's not enough value in making a construct that
is slightly different but functionally equivalent available unless it
provides something new.

 
For me the value is in 1) not hard coding the number and 2) being able to use more explicit names (eg "logfile" rather than "3"), nothing more.

Of course if you use {var} for the redirections of an external command it's useless but not using a hard coded number can be useful if you use functions and don't want to have conflicts with someone else's function.

I don't really understand why using a symbolic name would need to provide more control, and in my opinion  {var}> doesn't really provide something you can't do otherwise regarding the handling of the fd, it just has a different behavior.



reply via email to

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