[Gllug] sed enlightenment

Tom Robinson robinstc at ocean.com.au
Wed Sep 21 21:52:31 UTC 2005


On Sat, 2005-09-10 at 08:45 +0100, Alain Williams wrote:
> On Fri, Sep 09, 2005 at 05:53:29PM +0100, Thomas Robinson wrote:
> > Some might know what this does; so, just for a challenge, what does it
> > do?
> > 
> > s/\r$//
> > :top
> > /=$/{
> > N
> > s/=\n//
> > }
> > /=$/b top
> 
> Join a set of lines that end in '=' together, removing the '='.
> The treatment of carriage returns at the end of line is inconsistent,
> you might want to move the top label up a line.
> 

Correct! The first line is only used if you you have to remove the
carriage return in, say, a dos formatted text file. Really it should be
done as a separate invocation. Moving the label up doesn't help in this
instance.

-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list