~mmach/netext73/busybox

« back to all changes in this revision

Viewing changes to shell/hush_test/hush-quoting/bkslash_in_varexp.tests

  • Committer: mmach
  • Date: 2021-04-14 13:54:24 UTC
  • Revision ID: netbit73@gmail.com-20210414135424-8x3fxf716zs4wflb
1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
x='a]'
 
2
#
 
3
# \] is not a valid escape for ] in set glob expression.
 
4
# Glob sets have no escaping at all:
 
5
# ] can be in a set if it is the first char: []abc],
 
6
# dash can be in a set if it is first or last: [abc-],
 
7
# [ and \ need no protections at all: [a[b\c] is a valid set of 5 chars.
 
8
#
 
9
# bash-4.3.43 misinterprets [a\]] as "set of 'a' or ']'".
 
10
# Correct interpretation is "set of 'a' or '\', followed by ']'".
 
11
#
 
12
echo Nothing:${x#[a\]]}
 
13
echo Nothing:"${x#[a\]]}"
 
14
echo Nothing:${x%[a\]]}
 
15
echo Nothing:"${x%[a\]]}"
 
16
echo Ok:$?