On Tue, 2025-03-11 at 12:21 +0000, Geoff Clare via austin-group-l at
The Open Group wrote:
> Now that
> we do have a practical use, this is worth revisiting.

I've submitted:
https://www.austingroupbugs.net/view.php?id=1913


> > b) Does it even solve the original problem, or could e.g. such a
> > n<&n
> >    respectively m>&m fail itself (not e.g. because a file doesn't
> >    exist, but because of something like resource exhaustion, etc.)
> 
> It could potentially solve the original problem if we can get
> consensus
> to add something suitable to the standard.

It would probably not yet solve (b), or would it?


I mean not if it were merely defined as you propose:

> So I would support updating the standard to require that n<&n and
> n>&n are always a no-op if fd n is open, except that if the shell
> normally closes fds > 2, that were opened with exec, when it executes
> a non-built-in utility, then applying n<&n or n>&n to such commands
> causes fd n to remain open.

That would in principle still allow for such redirection to fail (e.g.
resource exhaustion), with no obvious way of detecting/handling such
cases.


Thanks,
Chris

        • ... Geoff Clare via austin-group-l at The Open Group
    • Re: exe... Christoph Anton Mitterer via austin-group-l at The Open Group
  • Re: exec red... Harald van Dijk via austin-group-l at The Open Group
    • Re: exe... Christoph Anton Mitterer via austin-group-l at The Open Group
      • Re:... Oğuz via austin-group-l at The Open Group
    • Re: exe... Christoph Anton Mitterer via austin-group-l at The Open Group
      • Re:... Geoff Clare via austin-group-l at The Open Group
        • ... Geoff Clare via austin-group-l at The Open Group
        • ... Steffen Nurpmeso via austin-group-l at The Open Group
          • ... Steffen Nurpmeso via austin-group-l at The Open Group
        • ... Christoph Anton Mitterer via austin-group-l at The Open Group
          • ... Geoff Clare via austin-group-l at The Open Group

Reply via email to