From: "Henrik Nordström" <henrik@henriknordstrom.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] hush variable expansion & quoting
Date: Thu, 16 May 2013 14:35:29 +0200 [thread overview]
Message-ID: <1368707729.18747.7.camel@localhost> (raw)
In-Reply-To: <1368551187.7365.6.camel@localhost>
tis 2013-05-14 klockan 19:06 +0200 skrev Henrik Nordstr?m:
> 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 b
Please 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 b
this 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
prev parent reply other threads:[~2013-05-16 12:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-14 17:06 [U-Boot] hush variable expansion & quoting Henrik Nordström
2013-05-16 12:35 ` Henrik Nordström [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1368707729.18747.7.camel@localhost \
--to=henrik@henriknordstrom.net \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox