blob: 5748b4ac7a29cf9fb5baa0d6a25e3a41ddb9ff65 [file] [log] [blame]
Denys Vlasenko36f774a2010-09-05 14:45:38 +02001# This testcase checks whether slashes in ${v/a/b} are parsed before
2# or after expansions
3
4v='a/b/c'
5s='b/c'
6r='e/f'
Denys Vlasenkoebee4102010-09-10 10:17:53 +02007echo "1 ${v/$s}"
8echo "2 ${v/$s/d}"
9echo "3 ${v/$s/$r}"
10
11v='a\b\c'
12s='b\\c'
13r='e\f'
14echo "4 ${v/$s}"
15echo "5 ${v/$s/d}"
16echo "6 ${v/$s/$r}"
17
18v='a\\b\\c'
19s='b\\\\c'
20r='e\\f'
21echo "7 ${v/$s}"
22echo "8 ${v/$s/d}"
23echo "9 ${v/$s/$r}"
24
25v='a-$a-\t-\\-\"-\`-\--\z-\*-\?-b'
26s='-$a-\\t-\\\\-\\"-\\`-\\--\\z-\\\*-\\\?-'
27echo "a ${v/$s}"
Denys Vlasenko36f774a2010-09-05 14:45:38 +020028
29echo Done: $?