bug-bash
[Top][All Lists]
Advanced

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

Re: ${p+\"$p\"}


From: Bize Ma
Subject: Re: ${p+\"$p\"}
Date: Mon, 21 Jan 2019 17:37:21 -0400

*From*: Dan Jacobson
*Subject*: ${p+\"$p\"}
*Date*: Mon, 21 Jan 2019 21:14:26 +0800
------------------------------

So how am I to get
"A"
with bash?



How about:

#!/bin/bash
p=A
q='"'
cat <<_EOF_
${p+$q$p$q}
_EOF_


Works on all shells I tested it.


reply via email to

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