Re: false-positive failure of the root-removal test
From:
Pádraig Brady
Subject:
Re: false-positive failure of the root-removal test
Date:
Thu, 15 Oct 2015 18:24:28 +0100
User-agent:
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0
On 15/10/15 18:12, Jim Meyering wrote:
> On Thu, Oct 15, 2015 at 9:44 AM, Pádraig Brady <address@hidden> wrote:
>> On 15/10/15 17:18, Pádraig Brady wrote:
>>> On 15/10/15 16:13, Jim Meyering wrote:
>>>> Here's a small improvement:
>>>
>>>> # Strip that part off for the following comparison.
>>>> clean_rm_err_()
>>>> {
>>>> - sed "s/.*rm: /rm: /; \
>>>> - s/\(rm: it is dangerous to operate recursively on\).*$/\1 '\/'/"
>>>> + sed 's,.*\(rm: it is dangerous to operate recursively on\).*$,\1 '"'/',"
>>>> }
>>
>> Actually I'm not sure the combined works as we need
>> to match against multiple lines starting with "rm:..."
>> See "exp" below in the script.
>
> Good points.
> My primary reaction was to the use of double quotes and "/" as the delimiter.
>
> Adjusting for that yields this:
>
> - sed "s/.*rm: /rm: /; \
> - s/\(rm: it is dangerous to operate recursively on\).*$/\1 '\/'/"
> + sed 's/.*rm: /rm: /
> + s,\(rm: it is dangerous to operate recursively on\).*$,\1 '"'/',"
>
> Worth it?
How about I add it to my "various cleanups and typos" patch
that I'm accumulating and will apply periodically?
cheers,
Pádraig