[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: licenses of tests
From: |
Jim Meyering |
Subject: |
Re: licenses of tests |
Date: |
Wed, 30 Dec 2009 15:54:11 +0100 |
Eric Blake wrote:
> According to Jim Meyering on 12/30/2009 1:44 AM:
>>> find modules -name '*-tests' | xargs grep -l License \
>>> | xargs sed -i '/^$/N; /License:/,$ d'
>>
>> Those changes look fine. Thanks.
>>
>> In case there's a next time, you'd want to add a "^"
>> before the "License:" in that sed command:
>
> That wouldn't have worked. The previous N command, to also delete the
> blank line prior to the License line, means that License is no longer at
> the beginning of the pattern stream. But this would do it:
>
> sed -i '/^$/N; /\n*License:$/,$ d'
Indeed. I should have tried it. I don't use sed's "N" enough.
Since these are all tiny files, I'd say just use Perl:
perl -0777 -pi -e 's/\n\n+License:\n.*\n/\n/'