bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

how does escaping in "`...`" work?


From: Matthew Woehlke
Subject: how does escaping in "`...`" work?
Date: Mon, 07 Jun 2010 17:47:12 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.23) Gecko/20090825 Fedora/2.0.0.23-1.fc10 Thunderbird/2.0.0.23 Mnenhy/0.7.5.0

(See also https://bugs.kde.org/show_bug.cgi?id=237675)

How should bash interpret escapes in constructs like "`...`"?

For example, this do what I would expect:

$ echo "`echo "you don't   say"`"
you don't   say

(That is, the contents in ``'s are parsed independent of any other context, except that additional `'s would need to be escaped for further nesting.)

But this does not:
$ echo "`echo \"you don\'t   say\"`"
you don\'t   say

I expected:
"you don't say"

That is, I expected that \" -> " substitution would not happen inside the ``'s outside of the context of the command substitution, since the quotes do not need to be escaped in that context to be seen as quotes in the substitution context.

Is this how it is supposed to work?

--
Matthew
Please do not quote my e-mail address unobfuscated in message bodies.
--
Will your shell have salvation? Only if it's Bourne Again.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]