about summary refs log tree commit diff
path: root/NEWS
diff options
context:
space:
mode:
authorBart Schaefer <schaefer@ipost.com>2021-06-13 16:30:06 -0700
committerBart Schaefer <schaefer@ipost.com>2021-06-13 16:30:06 -0700
commit5b4a1626c2efbbc4b46e8995e553ec2c14549904 (patch)
treed3ee7a205eb0013e2f58e26ec75cad58e3628752 /NEWS
parent667901b6ba8ea7871bfdb6364fb14cbcb70536b4 (diff)
downloadzsh-5b4a1626c2efbbc4b46e8995e553ec2c14549904.tar.gz
zsh-5b4a1626c2efbbc4b46e8995e553ec2c14549904.tar.xz
zsh-5b4a1626c2efbbc4b46e8995e553ec2c14549904.zip
49069: literal interpretation of subscripts for unset of array/hash elements
Diffstat (limited to 'NEWS')
-rw-r--r--NEWS12
1 files changed, 12 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index ee97868f9..c12ec3b0e 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,18 @@ Note also the list of incompatibilities in the README file.
 Changes since 5.8
 -----------------
 
+When unsetting a hash element, the string enclosed in square brackets is
+interpreted literally after any normal command-line-argument expansions.
+Thus
+  unset "hash[$key]"
+first expands $key as usual for a double-quoted string, and then interprets
+that result as the exact hash element to unset.  This differs from previous
+versions of the shell, which would also remove a leading backslash for an
+unusual subset of characters in the expansion of $key.  Note this also
+means, for example, that
+  unset 'hash[ab]cd]'
+unsets the element with key "ab]cd" rather than silently doing nothing.
+
 The function command learnt a -T option to declare a function and enable
 tracing for it simultaneously.