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: Maarten Billemont
Subject: Re: Inconsistent quote and escape handling in substitution part of parameter expansions.
Date: Tue, 28 Feb 2012 19:14:04 +0100

On 28 Feb 2012, at 18:52, John Kearney wrote:
> On 02/28/2012 06:43 PM, Dan Douglas wrote:
>> On Tuesday, February 28, 2012 06:38:22 PM John Kearney wrote:
>>> On 02/28/2012 06:31 PM, Dan Douglas wrote:
>>>> On Tuesday, February 28, 2012 05:53:32 PM Roman Rakus wrote:
>>>>> On 02/28/2012 05:49 PM, Greg Wooledge wrote:
>>>>>> On Tue, Feb 28, 2012 at 05:36:47PM +0100, Roman Rakus
>>>>>> wrote:
>>>>>>> And that means, there isn't way to substitute "something"
>>>>>>> to ' (single quote) when you want to not perform word
>>>>>>> splitting. I would consider it as a bug.
>>>>>> 
>>>>>> imadev:~$ q=\' imadev:~$ input="foosomethingbar" imadev:~$
>>>>>> echo "${input//something/$q}" foo'bar
>>>>> 
>>>>> I meant without temporary variable.
>>>>> 
>>>>> RR
>>>> 
>>>> ormaaj@ormaajbox ~ $ ( x=abc; echo ${x/b/$'\''} ) a'c
>>> 
>>> ( x=abc; echo "${x/b/$'\''}" ) -bash: bad substitution: no
>>> closing `}' in "${x/b/'}"
>>> 
>>> 
>>> you forgot the double quotes ;)
>>> 
>>> 
>>> I really did spend like an hour or 2 one day trying to figure it
>>> out and gave up.
>> 
>> Hm good catch. Thought there might be a new quoting context over
>> there.
> I think we can all agree its inconsistent, just not so sure we care??????
> i.e. we know workarounds that aren't so bad variables etc.


So essentially, we all agree it's buggy, but since we can work around the buggy 
behavior and since POSIX doesn't *require* it not be buggy, let's leave it be 
buggy?

How about making it behave properly instead?  And with properly, I mostly mean, 
make the quotes and backslashes behave as they do now inside, for example, a 
process substitution instead of a parameter expansion.

Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

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