aboutsummaryrefslogtreecommitdiff
path: root/shell/hush_test/hush-vars/var_bash5.tests
blob: 5748b4ac7a29cf9fb5baa0d6a25e3a41ddb9ff65 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# This testcase checks whether slashes in ${v/a/b} are parsed before
# or after expansions

v='a/b/c'
s='b/c'
r='e/f'
echo "1 ${v/$s}"
echo "2 ${v/$s/d}"
echo "3 ${v/$s/$r}"

v='a\b\c'
s='b\\c'
r='e\f'
echo "4 ${v/$s}"
echo "5 ${v/$s/d}"
echo "6 ${v/$s/$r}"

v='a\\b\\c'
s='b\\\\c'
r='e\\f'
echo "7 ${v/$s}"
echo "8 ${v/$s/d}"
echo "9 ${v/$s/$r}"

v='a-$a-\t-\\-\"-\`-\--\z-\*-\?-b'
s='-$a-\\t-\\\\-\\"-\\`-\\--\\z-\\\*-\\\?-'
echo "a ${v/$s}"

echo Done: $?