hush variable expansion & quoting
Quoting is broken (ignored/lost) when there is variable expansions
# test "a b" = c; echo $?
1
# v="a b"
# test "$v" = c; echo $?
0
# echo "a b"
a b
# v="a b"
# echo "$v"
a bRegards
Henrik
tis 2013-05-14 klockan 19:06 +0200 skrev Henrik Nordstr?m:
Quoted 12 lines
Quoting is broken (ignored/lost) when there is variable expansions
# test "a b" = c; echo $? 1 # v="a b" # test "$v" = c; echo $? 0 # echo "a b" a b # v="a b" # echo "$v" a b
And not entirely unexpected escaping helps here
# echo \"$v\"
a bPlease note that this issue hits the whole command "pipe" as soon as there is one variable expansion.
# echo "a b" "$v"
a b a b
# echo "a b" "a b"
a b a bthis due to the execution taking a quite differen path when there is variables involved, and quotes gets destroyied in that path.
upstream hush do not have this problem, but it's not entirely trivial to pinpoint what fixed it without running an bisect (too many related fixes & restructuring)
Regards
Henrik