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