blob: 00618b9db3ae69e6539805a51bbd41a69e78d618 [file] [log] [blame]
# This test demonstrates that in unquoted $v, backslashes expand by this rule:
# \z -> \\\z; \<eol> -> \\<eol> (for any z, special or not),
# and subsequently globbing converts \\ to \ and treats \z as literal z
# even if it is a special char.
echo 'Expected' 'Actual'
v='\*'; echo 'Z\* :' Z$v # ash is buggy here: prints 'Z\f'
echo 'Z* :' Z\*
echo 'Z\f :' Z\\*
echo 'Z\* :' Z\\\* # NB! only this matches Z$v output
v='\z'; echo 'Z\z :' Z$v
echo 'Zz :' Z\z
echo 'Z\z :' Z\\z
echo 'Z\z :' Z\\\z
v='\'; echo 'Z\ :' Z$v
echo 'Z\ :' Z\\
v='*'; echo 'Z\f Zf :' Z$v
echo 'Z\f Zf :' Z*
rm 'Z\f' 'Zf'
echo Done: $?