On 10/04/10 13:53, Jim Meyering wrote:
> Here's a rule I'm adding to coreutils' cfg.mk.
> However, I would like to use it several other projects,
> so rather than duplicating it in each, I'm thinking of
> putting it in gnulib's maint.mk.
> 
> Opinions?
> 
> I know that at least Bruno likes to retain trailing empty
> lines in modules/ files.  But for a class of files like that,
> it's easy to exempt "^modules/" or to omit the rule altogether.
> 
> Does anyone object to my adding this syntax check to maint.mk?
> 
> Aside from that, can anyone improve on the code?
> The multi-line Perl script is the only way I could get
> the efficiency I wanted, but there may well be another
> more concise way.

Maybe something like this?
tail -n1 files... | sed -n 's/==> \(.*\) <==/\1/; t blanks;d; :blanks h;n;/^ 
*$/{x;p};'
Though that won't work on solaris for example.

cheers,
Pádraig.


Reply via email to