[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bug batch
From: |
Linda Walsh |
Subject: |
Re: bug batch |
Date: |
Thu, 13 Jun 2013 02:54:57 -0700 |
User-agent: |
Thunderbird |
I can't speak to all your cases, but I had comments on a few:
Dan Douglas wrote:
Most shells (and GCC) consider not grouping the assignment in a situation like
this an error. Bash tolerates it, apparently reversing associativity:
: $((1 == x = 1)) # Error in dash/ksh/mksh/zsh/etc
----
If you do it without the ':', it returns a false status.
The colon doesn't seems to return true or false based on whether or not
there was a syntactic error, but not for a command that runs normally and
returns
any status.
2. += environment assignments
2a. POSIX mode += w/ special builtin.
You say you got an answer of '2'? When I did your test interactively,
it came out '25' in non-posix mode. (bash V 4.2.45). I have a feeling
that you asked for posix (dysfunctional) and got it. I don't recall
the posix standard specifying "+=" as an operator, but I'm FAR from an
expert on posix.
shell | inner | outer
bash: 5 2 #(4.2.45)
bash43: 5 5
ksh: 25 25
mksh: 25 25
zsh: 25 25
....
Anyway, don't have time to analyze the rest, but those above looked
like bash is doing the right thing...?
- bug batch, Dan Douglas, 2013/06/13
- Re: bug batch,
Linda Walsh <=