help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: is it really required that arr['1']=bla gives syntax error instead o


From: Lawrence Velázquez
Subject: Re: is it really required that arr['1']=bla gives syntax error instead of parse '1' as 1
Date: Mon, 19 Jul 2021 13:45:10 -0400
User-agent: Cyrus-JMAP/3.5.0-alpha0-533-gf73e617b8a-fm-20210712.002-gf73e617b

On Mon, Jul 19, 2021, at 12:45 PM, Greg Wooledge wrote:
> 
> > On Mon, Jul 19, 2021, 17:57 Greg Wooledge <greg@wooledge.org> wrote:
> > > In <https://lists.gnu.org/archive/html/bug-bash/2021-02/msg00189.html>
> > > Chet says that "The contents of (( are expanded as if they are between
> > > double quotes".
> 
> On Mon, Jul 19, 2021 at 06:27:28PM +0200, Alex fxmbsw7 Ratchev wrote:
> > (( "2" + 4 ))
> > noerr
> 
> Yes.  Double quotes work.  Single quotes don't.  I believe this is
> because of what Chet said about the contents of (( being treated as
> if they're inside double quotes already.

The man page says that "[t]he expression is treated as if it were
within double quotes, but a double quote inside the parentheses is
not treated specially." Presumably that means that double quotes
are removed as usual.  POSIX contains similar language.

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_04

-- 
vq



reply via email to

[Prev in Thread] Current Thread [Next in Thread]