|Subject:||Re: Curious case of arithmetic expansion|
|Date:||Sun, 23 Apr 2017 15:07:20 +0200|
It does not matter, how this construct in this particular context is called.
The difference between $(()) and (()) is that $(()) actually expands to something
whereas (()) just executes a C-like _expression_. In ((<_expression_>)) <_expression_> can also
include assignments, as the bash manual that you properly cited, also elaborates on.
You can do, for example, things like
$ ((foo+=100)) # fo is now 102
$ ((foo++, foo++, foo++, foo++, foo+=100))
and (oh boy why) even
$ foo=(123 321)
$ ((foo++, foo—))
So I might have chosen the wrong subject text for this mail,
but again, it does not matter whether those constructs actually expand to some string
or not. The side effects are what matter here. And in my opinion those are not correct...
|[Prev in Thread]||Current Thread||[Next in Thread]|