[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] tests: remove all unportable uses of echo
From: |
Eric Blake |
Subject: |
Re: [PATCH] tests: remove all unportable uses of echo |
Date: |
Thu, 01 Apr 2010 11:10:28 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100301 Fedora/3.0.3-1.fc12 Lightning/1.0b1 Thunderbird/3.0.3 |
On 04/01/2010 11:07 AM, Jim Meyering wrote:
> Eric Blake wrote:
>> On 04/01/2010 04:17 AM, Jim Meyering wrote:
>>>
>>> +sc_prohibit_echo_minus_en:
>>> + @re='\<echo -[en]' \
>>> + msg='do not use echo ''-e or echo ''-n; use printf instead' \
>>> + $(_prohibit_regexp)
>>
>> This would be nice in gnulib, alongside the rule against test -a.
>
> Yes, it's on my list.
While we're at it, can $re be broadened to catch other unportable usage
patterns? Pretty much _any_ leading - is unportable, as is any embedded
\, and since $ or ` for command substitution can hide \, they are worth
checking as well. In other words, I'm thinking:
@re='\<echo (-|.*[$`\])'
with a corresponding change in $msg.
--
Eric Blake address@hidden +1-801-349-2682
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature