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.
--
``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/