2010-09-04 23:22:44 +05:30
|
|
|
# This testcase checks whether slashes in ${v/a/b} are parsed before
|
|
|
|
# or after expansions
|
2010-08-30 17:24:12 +05:30
|
|
|
|
|
|
|
v='a/b/c'
|
|
|
|
s='b/c'
|
|
|
|
r='e/f'
|
2016-10-02 21:38:04 +05:30
|
|
|
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}"
|
2010-08-30 17:24:12 +05:30
|
|
|
|
|
|
|
echo Done: $?
|