On 1/21/19 8:14 AM, Dan Jacobson wrote:
> So how am I to get
> "A"
> with bash?

echo ${p+\"$p\"}


> $ cat z
> p=A
> cat <<EOF
> ${p+\"$p\"}
> ${p+"$p"}
> EOF
> $ bash z
> \"A\"
> A

It's the here-document. Backslashes and double quotes in here documents are
kind of strange. This is historical sh behavior.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    c...@case.edu    http://tiswww.cwru.edu/~chet/

Reply via email to