Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #11384
| Path | csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!usenet.stanford.edu!not-for-mail |
|---|---|
| From | Dan Douglas <ormaaj@gmail.com> |
| Newsgroups | gnu.bash.bug |
| Subject | Re: quoted compound array assignment deprecated |
| Date | Tue, 18 Aug 2015 16:05:04 -0500 |
| Lines | 22 |
| Approved | bug-bash@gnu.org |
| Message-ID | <mailman.8573.1439931911.904.bug-bash@gnu.org> (permalink) |
| References | <CAAZkfoJJdVc5A9WMmBcUqUMjN=2VBq6rtuoDYVO5iMQDoLjS9Q@mail.gmail.com> <CAAZkfoJyOyo=2zE63OYaZua73E-HCTd4bCmMkJDNzhJ5hgVAgw@mail.gmail.com> <55D38D5C.2050605@case.edu> |
| NNTP-Posting-Host | lists.gnu.org |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset="UTF-8" |
| Content-Transfer-Encoding | 7Bit |
| X-Trace | usenet.stanford.edu 1439931912 25916 208.118.235.17 (18 Aug 2015 21:05:12 GMT) |
| X-Complaints-To | action@cs.stanford.edu |
| Cc | isabella parakiss <izaberina@gmail.com> |
| To | bug-bash@gnu.org, chet.ramey@case.edu |
| Envelope-to | bug-bash@gnu.org |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding:content-type; bh=uDdF5vMoPG7HyRZEwlQxtB2Cyvj+ihpGk1O9Du21cDw=; b=lYkB/OI2zXmvE14Ktdl9Cr1X9QkeBGtQlA/e8fKhnXz3PvWR/xSv7bTd74WKHD0c6T hIy9oLqlrGzSu4k8SV3lGNvt3KTqMwgMbnj2h+wMDPEQ4gBOeztu+21Z+wMLgV0mcUWf ZeksElWfw0+xMwtIPbCQZCaX2QOoAe3h5A11AgaVzslv3ikyEo1LX/CsHa/XxYBUt5Uq Ogel+acDd6XRlkWVVMSte7m0W+Jserq+LHBQVXTxvC5EfWyCVZgpI4b2gp+OK/varP8W TlNiZs5dITrtJdfKWrI2Wmm1LBeLR2qjQ2fh55kqRvbsNbZsAPDY3TgY/80oiHyCBBFQ UyZw== |
| X-Received | by 10.50.66.129 with SMTP id f1mr23198331igt.7.1439931906545; Tue, 18 Aug 2015 14:05:06 -0700 (PDT) |
| User-Agent | KMail/5.0.42 alpha1 (Linux/4.2.0-rc7; KDE/5.14.0; x86_64; ; ) |
| In-Reply-To | <55D38D5C.2050605@case.edu> |
| X-detected-operating-system | by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). |
| X-Received-From | 2607:f8b0:4001:c05::234 |
| X-BeenThere | bug-bash@gnu.org |
| X-Mailman-Version | 2.1.14 |
| Precedence | list |
| List-Id | Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org> |
| List-Unsubscribe | <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe> |
| List-Archive | <http://lists.gnu.org/archive/html/bug-bash> |
| List-Post | <mailto:bug-bash@gnu.org> |
| List-Help | <mailto:bug-bash-request@gnu.org?subject=help> |
| List-Subscribe | <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe> |
| Xref | csiph.com gnu.bash.bug:11384 |
Show key headers only | View raw
Sorry I meant to reply to that thread but ran out of time. I think Stephane's
eventual proposal was pretty close to what I had in mind but expressed badly.
I'm not sure why it was eventually decided to deprecate the current system
entirely but I'm not opposed to the idea - especially if it provides no
functionality for which there aren't easy workarounds.
The only thing I'm actively abusing this for at the moment in scripts I
actually use is as a way of encoding 2D arrays. It's very much a read-only
datastructure too.
~ $ ( key1=foo key2=bar; declare -A a=([foo]='([bar]=baz)') "b=${a[$key1]}"
typeset -p a b; echo "${b[$key2]}" )
declare -A a='([foo]="([bar]=baz)" )'
declare -A b='([bar]="baz" )'
baz
Any change will likely break this property but I think wrapping it in eval
gives the same result.
--
Dan Douglas
Back to gnu.bash.bug | Previous | Next | Find similar
Re: quoted compound array assignment deprecated Dan Douglas <ormaaj@gmail.com> - 2015-08-18 16:05 -0500
csiph-web