bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: Avoid unportable nested double-quotes and backquotes.


From: Eric Blake
Subject: Re: Avoid unportable nested double-quotes and backquotes.
Date: Mon, 24 May 2010 11:13:58 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-3.fc13 Lightning/1.0b1 Mnenhy/0.8.2 Thunderbird/3.0.4

On 05/23/2010 05:54 AM, Ralf Wildenhues wrote:
> Hi Bruno,
> 
> * Bruno Haible wrote on Sun, May 23, 2010 at 01:37:41PM CEST:
>>> noticed this small shell unportability in gnulib coming from gettext.
>>> ...
>>>          ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
>>> -        ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
>>> +        ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
>>
>> There is no unportability here. I tested these statements
> [...]
>> In summary, I did find a shell that does not understand "`...\"...\"...`"
>> but I did not find a shell that does not understand "`..."..."...`". That
>> paragraph in autoconf.texi dates back to 2000-05-19 12:17:29. It may have
>> referred to shells that were in common use between 1995 and 2000 and have
>> disappeared by now.
> 
> Thanks for testing.  I'm fairly sure I've come across a shell that
> doesn't like this in the last few years, but don't remember which, and
> it might have been on an old system.  ATM some of my test systems aren't
> reachable though, so I can't confirm this.

I'm not sure which systems are affected, but I do know that you will
have issues with "`...\"...\"...`".  There is an ambiguity of whether
the \" will be interpolated by the outer "" or by the ``, so some shells
will pass \" to the `` while others pass just " to the ``.

But yes, it would be nice to have an actual counterexample from a modern
machine, to update that section in the autoconf manual about why we
should still worry about that failure.

-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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