bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Arithmetic expression: recursive VAR evaluation suppresses desired V


From: Steffen Nurpmeso
Subject: Re: Arithmetic expression: recursive VAR evaluation suppresses desired VAR assignment
Date: Thu, 11 Aug 2022 16:00:49 +0200
User-agent: s-nail v14.9.24-284-gd57ba63239

Koichi Murase wrote in
 <CAFLRLk8GSmt7Pk=o5+xhqEBeSGA2SUAQ2NVnjhPSi+wo2rTL6w@mail.gmail.com>:
 |2022年8月11日(木) 9:01 Steffen Nurpmeso <steffen@sdaoden.eu>:
 |>   #?0|kent:tmp$ /x/src/busybox.git/busybox sh xxx.sh
 |>   <6><0><6><I2+=1>
 |>   <1><1><5><I2+=1>
 |
 |It seems your busybox interprets« I1=0?I1:I3 » as « (I1=0)?I1:I3 »,
 |but this violates POSIX XCU 2.6.4 and XCU 1.1.2. Also, the above

Hm.  Sigh.  Yes, you are of course right.  Thanks for the
clarification.

 |behavior doesn't seem to be reproduced by recent versions of busybox.

Yes, that could eventually be a contribution of mine.  Because..

  ...
 |The behavior of recent versions of busybox is still broken. The third
 ...
 |> I think the busybox variant is correct.
 |
 |I think both your version and recent versions of busybox sh are broken.

Yes.  The Dijkstra algorithm requires quite some contortions to
work with anything beyond binary.  I thought i had it now, but
obviously i need a third iteration round.

Thanks again.
Can you also explain this:

  $ bash -c ' I1=I2=10 I2=5 I3=I2+=1; echo "<$(( I1*=1?I1:I3 ))>";echo 
"<$I1><$I2><$I3>"'
  <100>
  <100><10><I2+=1>
  $ bash -c ' I1=I2=10 I2=5 I3=I2+=1; echo "<$(( I1=1?I1:I3 ))>";echo 
"<$I1><$I2><$I3>"'
  <10>
  <10><10><I2+=1>


--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]