Chet Ramey wrote in <a33a5106-8ffc-d7d4-a17d-454f108b1...@case.edu>: |On 8/11/22 10:00 AM, Steffen Nurpmeso wrote: |. |> 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> | |I1 *= 1?I1:I3 |I1 *= I1 |I1 = I1 * I1 |I1 = (I2=10) * (I2=10) |I1 = 10 * 10 |I1 = 100 | |Along the way, I2 is set to 10. Twice. | |> $ bash -c ' I1=I2=10 I2=5 I3=I2+=1; echo "<$(( I1=1?I1:I3 ))>";echo \ |> "<$I1><$I2><$I3>"' | |I1 = 1?I1:I3 |I1 = I1 |I1 = (I2 = 10) |I1 = 10 | |Ditto about I2, but once.
Yes, thank you. I had a fix $(()) precedence bug in "X=A?B:C" (it is _not_ "(X=A)?..)" enlightenment in the meantime (it was a simple precedence bug, a single line fix, i should have sat down and let it rest for a while, for weeks i was looking at myriads of Dijkstra stack pop debug messages, maybe that explains a bit). And it was all my fault. bash is absolutely on the correct side -- luckily there was a fully fledged parser i could use to test against! Thank you. Sorry for all the noise. --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)