On Thu, Jun 06, 2019 at 11:33:56AM +1000, David wrote:
> Regarding $((...)) when Chet refers above to "the expression between the 
> parens"
> he means whatever is between the parentheses, in this case the three dots.
> 
> If I understand correctly, Chet is saying there that $((...)) is
> parsed as if it was written
> $(("...")) and therefore any single quotes inside the parentheses are
> not special.

But...

On Tue, Jun 04, 2019 at 09:24:27AM -0400, Greg Wooledge wrote:
> wooledg:~$ a=(foo bar baz)
> wooledg:~$ i='$(date >&2)'
> wooledg:~$ echo $(( a[$i] ))
> Tue 04 Jun 2019 09:23:28 AM EDT
> 0

> wooledg:~$ echo $(( 'a[$i]' ))
> bash: 'a[$(date >&2)]' : syntax error: operand expected (error token is 
> "'a[$(date >&2)]' ")

I definitely got different results when I added single quotes.

Reply via email to