From 55f8133a4fb207d6fecd02f43c36809d3c2f6672 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 2 Mar 2018 18:12:12 +0100 Subject: shell: tweak bkslash_in_varexp.tests, add bkslash_in_varexp1.tests It turns out bkslash_in_varexp.tests was a bash bug :] ash and hush fail "corrected" bkslash_in_varexp.tests as well, just not as badly as I thought (hush gets half of the cases right). Signed-off-by: Denys Vlasenko --- shell/hush_test/hush-quoting/bkslash_in_varexp.tests | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'shell/hush_test/hush-quoting/bkslash_in_varexp.tests') diff --git a/shell/hush_test/hush-quoting/bkslash_in_varexp.tests b/shell/hush_test/hush-quoting/bkslash_in_varexp.tests index 41b31ab54..6c7b4b0cc 100755 --- a/shell/hush_test/hush-quoting/bkslash_in_varexp.tests +++ b/shell/hush_test/hush-quoting/bkslash_in_varexp.tests @@ -1,4 +1,14 @@ -x=a +x='a]' +# +# \] is not a valid escape for ] in set glob expression. +# Glob sets have no escaping at all: +# ] can be in a set if it is the first char: []abc], +# dash can be in a set if it is first or last: [abc-], +# [ and \ need no protections at all: [a[b\c] is a valid set of 5 chars. +# +# bash-4.3.43 misinterprets [a\]] as "set of 'a' or ']'". +# Correct interpretation is "set of 'a' or '\', followed by ']'". +# echo Nothing:${x#[a\]]} echo Nothing:"${x#[a\]]}" echo Nothing:${x%[a\]]} -- cgit v1.2.3