bug-bash
[Top][All Lists]
Advanced

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

Re: Print non-readonly variables with declare +r -p


From: Chet Ramey
Subject: Re: Print non-readonly variables with declare +r -p
Date: Thu, 15 Dec 2011 09:50:30 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:8.0) Gecko/20111105 Thunderbird/8.0

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12/14/11 4:10 PM, Dan Douglas wrote:

> Ah. I had assumed the single quotes added around array compound asssignment 
> broke this (intentionally?), but now I see it's valid. I expected declare -a 
> y='([0]="a" [1]="b c" [2]="d")' to set the first element of y to that entire 
> string.

Recall that arguments to builtin commands already go through a round of
expansion, including quote removal, before they're processed as assignment
statements.

- -- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7qCTYACgkQu1hp8GTqdKsI2QCfanW1KVPIYCTEeggvDb7zErMw
AxcAoIcNPk/OOShyRArzu9UdQpdDGRsb
=QiC0
-----END PGP SIGNATURE-----



reply via email to

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