Robert Elz wrote in
<16667.1660234...@jacaranda.noi.kre.to>:
|Date:Thu, 11 Aug 2022 16:22:12 +0200
|From:Steffen Nurpmeso
|Message-ID: <20220811142212.jhlpj%stef...@sdaoden.eu>
|
|
|||> Hm. Well i agree that precedence rules which loose a construct
|||> comple
Chet Ramey wrote in
:
|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>
|
|I1 *= 1?I1:I3
|I1 *= I1
|I1 = I1 * I1
|I1 = (I2
Steffen Nurpmeso wrote in
<20220811140049.avjlp%stef...@sdaoden.eu>:
|Koichi Murase wrote in
| :
||2022年8月11日(木) 9:01 Steffen Nurpmeso :
...
||I think both your version and recent versions of busybox sh are broken.
It was a one line fix.
- while(lprec > a_SHEXP_ARITH_PREC
Date:Thu, 11 Aug 2022 16:22:12 +0200
From:Steffen Nurpmeso
Message-ID: <20220811142212.jhlpj%stef...@sdaoden.eu>
| |> Hm. Well i agree that precedence rules which loose a construct
| |> completely (in that =5 is lost in I=5?I:J) is weird, but other
I seem to
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>
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
Greg Wooledge wrote in
:
|On Thu, Aug 11, 2022 at 04:04:57PM +0200, Steffen Nurpmeso wrote:
|> Hm. Well i agree that precedence rules which loose a construct
|> completely (in that =5 is lost in I=5?I:J) is weird, but other
|
|What's that even supposed to *be*? You're assigning I=5 and then
On Thu, Aug 11, 2022 at 04:04:57PM +0200, Steffen Nurpmeso wrote:
> Hm. Well i agree that precedence rules which loose a construct
> completely (in that =5 is lost in I=5?I:J) is weird, but other
What's that even supposed to *be*? You're assigning I=5 and then
checking whether the assignment act
Robert Elz wrote in
<26517.1660182...@jacaranda.noi.kre.to>:
|I would agree that the values bash is producing don't make a lot
|sense, but I don't think you can say that either is correct - one
|may be more desirable than the other, but that's it.
Hm. Well i agree that precedence rules which
Koichi Murase wrote in
:
|2022年8月11日(木) 9:01 Steffen Nurpmeso :
|> #?0|kent:tmp$ /x/src/busybox.git/busybox sh xxx.sh
|> <6><0><6>
|> <1><1><5>
|
|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.
I would agree that the values bash is producing don't make a lot
sense, but I don't think you can say that either is correct - one
may be more desirable than the other, but that's it.
Var expansion (not $I but just I) is defined for $(( )) only when
I contains a integer constant (optionally signed
2022年8月11日(木) 9:01 Steffen Nurpmeso :
> #?0|kent:tmp$ /x/src/busybox.git/busybox sh xxx.sh
> <6><0><6>
> <1><1><5>
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
behavior doesn't seem to be reproduced by re
Hello.
Given this file
# make this work with (ba)sh \
command -v shopt && shopt -s expand_aliases;\
alias p=printf;alias e=echo;alias s=export
s I1=I1=10 I2=5 I3=I2+=1;p "<$((I1=0?I1:I3))>";e "<$I1><$I2><$I3>"
s I1=I1=10 I2=5 I3=I2+=1;p "<$((I1=1?I1:I3))>";e "<$I1><$I2><$I3>"
i now see
12 matches
Mail list logo