bug-gnulib
[Top][All Lists]
Advanced

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

Re: gnulib-tool incorrectly handles library names with dashes


From: Jim Meyering
Subject: Re: gnulib-tool incorrectly handles library names with dashes
Date: Thu, 05 Jul 2007 14:39:17 +0200

Bruno Haible <address@hidden> wrote:
> Jim Meyering wrote:
>> I know you didn't change the single quotes (maybe it's Bruno's
>> stylistic preference to use them?)
>
> Yes, it's my stylistic preference.
>
>> but they are superfluous. There's less syntax this way:
>>
>>     libname_upper=`echo "$libname" | LC_ALL=C tr a-z- A-Z_`
>
> But it's not more readable this way.

I know better than to try to convert you :-)
and I can see how it might be a close call for some,
but I see it as an improvement:

  the original: 3 types of quotes and 8 quote characters total
  no s.quotes:  2 types of quotes and 4 quote characters, and none in proximity

> One can remove the surrounding quotes of sed arguments:
>   sed -e s/\\/[^/]\*\$//
> but it doesn't become more readable this way.

Of course not.  BTW, that's probably not what you meant.  You should
quote the square brackets, too, otherwise the shell may interpret them.

The difference in your sed example is that removing the quotes requires
adding _more_ syntax (backslashes) to protect each and every shell
meta-character.  The version without single quotes is far less readable
and not maintainable.

However, with the tr strings above, there is no need for additional
quoting, so the result is a net decrease in syntax.




reply via email to

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