bug-bash
[Top][All Lists]
Advanced

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

Re: Inconsistent quote and escape handling in substitution part of param


From: Roman Rakus
Subject: Re: Inconsistent quote and escape handling in substitution part of parameter expansions.
Date: Tue, 28 Feb 2012 17:22:36 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120209 Thunderbird/10.0.1

On 02/28/2012 05:10 PM, John Kearney wrote:
wrap it with single quotes and globally replace all single quotes in the
string with '\''
single quote and slash have special meaning so they have to be escaped, that's it.
\'${var//\'/\\\'}\'
it is not quoted, so it undergoes word splitting. To avoid it quote it in double quotes, however it changes how slash and single quote is treated.
"'${var//\'/\'}'"

Wasn't it already discussed on the list?

RR



reply via email to

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