hush: fix handling of \" in quoted/unquoted cmd

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
This commit is contained in:
Denys Vlasenko
2010-09-12 15:05:39 +02:00
parent 958581a8d9
commit acd5bc8f64
5 changed files with 50 additions and 22 deletions

View File

@@ -2,5 +2,5 @@
$TEST
Q
a\bc
a"c
11-$a-\t-\-\"-`-\--\z-\*-\?-22 33-$a-\t-\-"-`-\--\z-\*-\?-44
done:0

View File

@@ -7,6 +7,8 @@ echo `echo '\'TEST\`echo ZZ\`BEST`
echo `echo \\$TEST`
echo `echo \$TEST`
echo a`echo \\\\b`c
# \" etc are NOT special (passed verbatim WITH \)!
echo a`echo \"`c
# \" is not special if in unquoted `cmd` (passed verbatim WITH \),
# but is special in quoted one
echo `echo 11'-$a-\t-\\-\"-\`-\--\z-\*-\?-'22` "`echo 33'-$a-\t-\\-\"-\`-\--\z-\*-\?-'44`"
echo done:$?