On 4/5/23 11:25 AM, Oğuz wrote:
5 Nisan 2023 Çarşamba tarihinde Chet Ramey via austin-group-l at The Open Group <austin-group-l@opengroup.org <mailto:austin-group-l@opengroup.org>> yazdı:

    but should it
be set fron the command substitution for the assignment to c?

I think it'd be practical, is there a reason why it shouldn't?

https://www.austingroupbugs.net/view.php?id=1150

It's unspecified. The assignments are performed `beginning to end', but
it's not specified when $? is set. Interestingly, the SVR4 sh and ksh88
both set $? as each command substitution finishes, but POSIX didn't specify
that behavior explicitly. Maybe the 1992 authors didn't feel they had to.

And while
we're at it, is there a reason why assignments in a simple command shouldn't be applied sequentially, from left to right?

The Bourne shell performed the assignments right to left. This came up on
the austin-group list a couple of years ago, in almost exactly the same
way, but I don't think the discussion made its way to an interpretation
request.

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

  • $? behaviour after c... Martijn Dekker via austin-group-l at The Open Group
    • Re: $? behaviou... Chet Ramey via austin-group-l at The Open Group
      • Re: $? beha... Oğuz via austin-group-l at The Open Group
        • Re: $? ... Chet Ramey via austin-group-l at The Open Group
        • Re: $? ... Harald van Dijk via austin-group-l at The Open Group
          • Re:... Oğuz 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
                • ... Steffen Nurpmeso via austin-group-l at The Open Group
              • ... Oğuz via austin-group-l at The Open Group
              • ... Harald van Dijk via austin-group-l at The Open Group
      • Re: $? beha... Harald van Dijk via austin-group-l at The Open Group
        • Re: $? ... Chet Ramey via austin-group-l at The Open Group
          • Re:... Harald van Dijk via austin-group-l at The Open Group

Reply via email to