Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #16039

Re: leaks fd for internal functions but not external command

From Sam Liddicott <sam@liddicott.com>
Newsgroups gnu.bash.bug
Subject Re: leaks fd for internal functions but not external command
Date 2020-03-20 11:28 +0000
Message-ID <mailman.184.1584703772.3020.bug-bash@gnu.org> (permalink)
References (13 earlier) <CAOj-5WD0jLQN4eX=gf+wqjRAz4YHVw_9wr747-Gh3dsOkNhXjQ@mail.gmail.com> <8761ae1a-f51c-e468-0a32-3447bfa7f287@case.edu> <CAOj-5WBJA_nxhQ=_Y7307darqs2L55mZqCCU8YOvwN64YwkFGQ@mail.gmail.com> <91868af9-f8a6-bbe2-2983-187683ab5a87@case.edu> <CAOj-5WBWF-o3tKiFti+6uQG6kULXk_=N9UD4AvvKxZZK4+TuOA@mail.gmail.com>

Show all headers | View raw


This just made me sad:

tedious_function() {
  : # lots of stuff
} {BASH_XTRACEFD}>/dev/null

it would be so cool to be able to disable debug output BASH_XTRACEFD like
that whether or not BASH_XTRACEFD was set.
I guess the variable would have to be local to the function invocation too.

Please add it to the wishlist for bash 5 ;-)


On Thu, 25 Jul 2019 at 15:11, Chet Ramey <chet.ramey@case.edu> wrote:

> On 7/25/19 9:03 AM, Sam Liddicott wrote:
>
> > Perhaps if the named fd is also closed on the same statement that opened
> > it, it could be kept closed rather than saved and re-opened.
> > Being closed at the same statement is a strong indicator that it was only
> > used to aid fd transplants. Why keep open what the author closed?
>
> That's an interesting suggestion. I considered it at some point, and
> there's even a comment in the code about it. I'll look at it again.
>
> 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://tiswww.cwru.edu/~chet/
>

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: leaks fd for internal functions but not external command Sam Liddicott <sam@liddicott.com> - 2020-03-20 11:28 +0000

csiph-web