diff options
Diffstat (limited to 'shell/ash_test')
-rwxr-xr-x | shell/ash_test/ash-quoting/bkslash_in_varexp.tests | 12 | ||||
-rw-r--r-- | shell/ash_test/ash-quoting/bkslash_in_varexp1.right | 5 | ||||
-rwxr-xr-x | shell/ash_test/ash-quoting/bkslash_in_varexp1.tests | 6 |
3 files changed, 22 insertions, 1 deletions
diff --git a/shell/ash_test/ash-quoting/bkslash_in_varexp.tests b/shell/ash_test/ash-quoting/bkslash_in_varexp.tests index 41b31ab54..6c7b4b0cc 100755 --- a/shell/ash_test/ash-quoting/bkslash_in_varexp.tests +++ b/shell/ash_test/ash-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\]]} diff --git a/shell/ash_test/ash-quoting/bkslash_in_varexp1.right b/shell/ash_test/ash-quoting/bkslash_in_varexp1.right new file mode 100644 index 000000000..d03047024 --- /dev/null +++ b/shell/ash_test/ash-quoting/bkslash_in_varexp1.right @@ -0,0 +1,5 @@ +Nothing: +Nothing: +Nothing: +Nothing: +Ok:0 diff --git a/shell/ash_test/ash-quoting/bkslash_in_varexp1.tests b/shell/ash_test/ash-quoting/bkslash_in_varexp1.tests new file mode 100755 index 000000000..3c817eae1 --- /dev/null +++ b/shell/ash_test/ash-quoting/bkslash_in_varexp1.tests @@ -0,0 +1,6 @@ +x=a +echo Nothing:${x#[]a]} +echo Nothing:"${x#[]a]}" +echo Nothing:${x%[]a]} +echo Nothing:"${x%[]a]}" +echo Ok:$? |