On 05/04/2023 16:25, Oğuz via austin-group-l at The Open Group 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? 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? Most shells already do it that way; that is,

     a=1 b=$a c=$b
     echo $a $b $c

prints `1 1 1' in them. Outliers are ash based shells; they apply assignments concurrently but it isn't useful at all.

Note that in dash, this only applies to older versions. dash 0.5.7 (released in 2011) and higher print "1 1 1" like almost all other shells, and other dash-derived shells (busybox ash, and my own) keep it that way.

I am not sure which other ash based shells you were looking at, but it may be worth making sure you are on a current version.

Cheers,
Harald van Dijk

  • $? 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
            • ... Chet Ramey via austin-group-l at The Open Group

Reply via email to