Denys Vlasenko | e298ce6 | 2010-09-04 19:52:44 +0200 | [diff] [blame] | 1 | # This testcase checks whether slashes in ${v/a/b} are parsed before |
| 2 | # or after expansions |
Denys Vlasenko | f7a8433 | 2010-08-30 13:54:12 +0200 | [diff] [blame] | 3 | |
| 4 | v='a/b/c' |
| 5 | s='b/c' |
| 6 | r='e/f' |
Denys Vlasenko | e3354bc | 2016-10-02 18:08:04 +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 | f7a8433 | 2010-08-30 13:54:12 +0200 | [diff] [blame] | 28 | |
| 29 | echo Done: $? |