Subject: Re: [PATCH Cogito] Make use of external editor work like CVS

From: "Sean" <[email-masked]>
Date: Sun, 8 May 2005 17:46:48 -0400 (EDT)

On Sun, May 8, 2005 4:26 pm, Marcel Holtmann said:

> /*
>  * Remove empty lines from the beginning and end.
>  *
>  * Turn multiple consecutive empty lines into just one
>  * empty line.
>  */

sed ' 1{:a;s/^[ \t]*$//;T;N;s/\n//;ta}
      /^[ \t]*$/{:b;$d;N;s/\n[ \t]*$//;tb}'  filename

There's probably shorter... but it's mothers day.. time to go!

Cheers,
Sean