[Help-bash] Question about escaping in backquote string in double quoted
From:
KHMan
Subject:
[Help-bash] Question about escaping in backquote string in double quoted strings
Date:
Fri, 3 May 2019 01:05:47 +0800
User-agent:
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2
Hi all,
I have a question about escaping of the double quote char in a
backquote command string nested inside a double quoted string. I
have been trying out an example from the Morbig paper[1] and
looking at the bash ref man but couldn't figure things out.
Here is a slightly adjusted example from page 4, Example 2.5.
Output is at right after the comment #.
In section 3.5.4 Command Substitution, no mention about escaping
double quotes is made. I understand (B) but not (A). Who processed
the \" into " in (A), because when I tried the $(command) form, no
escape processing was done whether the command string is on its
own or nested inside a double quoted string (C)-(F):
So my question is, what did bash do in (A), which seems to affect
the specific case of the double quote char only?
NOTE: While I used the online bash ref man (Edition 5.0, last
updated 7 December 2018), I only managed to run the above snippets
on the following with identical results: