On 3/18/25 9:20 AM, Harald van Dijk via austin-group-l at The Open Group wrote:

The original wording suggested to me that 0<&0 was considered an explicit redirection with unspecified/underspecified behaviour, and that like any other explicit redirection prevents the implicit 0</dev/null from taking place, and then after that, because stdin is still the original stdin, doing the sensible thing for that unspecified/underspecified behaviour, 0<&0 would continue to use the original stdin.

Yes. Since it was, as Geoff said, unspecified until this very instant, 0<&0
was considered an explicit redirection.

Notable shells that do it this way are bash and ksh, including in POSIX mode, so if a change is made here, that is probably worth calling out explicitly.

Since bash has always behaved this way, I don't see how changing this helps
users.


--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    [email protected]    http://tiswww.cwru.edu/~chet/

    • Re: [... Harald van Dijk via austin-group-l at The Open Group
      • R... Geoff Clare via austin-group-l at The Open Group
        • ... Harald van Dijk via austin-group-l at The Open Group
          • ... Geoff Clare via austin-group-l at The Open Group
            • ... Harald van Dijk via austin-group-l at The Open Group
              • ... Geoff Clare via austin-group-l at The Open Group
              • ... Harald van Dijk via austin-group-l at The Open Group
              • ... Steffen Nurpmeso via austin-group-l at The Open Group
              • ... Chet Ramey via austin-group-l at The Open Group
            • ... Chet Ramey via austin-group-l at The Open Group
          • ... Chet Ramey via austin-group-l at The Open Group
        • ... Lawrence Velázquez via austin-group-l at The Open Group
          • ... Harald van Dijk via austin-group-l at The Open Group
  • [1003.1(20... Austin Group Issue Tracker via austin-group-l at The Open Group
  • [1003.1(20... Austin Group Issue Tracker via austin-group-l at The Open Group
  • [1003.1(20... Austin Group Issue Tracker via austin-group-l at The Open Group
  • [1003.1(20... Austin Group Issue Tracker via austin-group-l at The Open Group
  • Fwd: Re: [... Chet Ramey via austin-group-l at The Open Group
    • Re: F... Geoff Clare via austin-group-l at The Open Group
      • R... Chet Ramey via austin-group-l at The Open Group
        • ... Geoff Clare via austin-group-l at The Open Group

Reply via email to