[K12OSN] Help with sed script!

Les Mikesell les at futuresource.com
Thu Aug 9 17:42:33 UTC 2007

Timothy Legge wrote:

> cat filename | perl -lp0e 's/DC=LO\n.*CAL/DC=LOCAL\n/g'
> will combine the lines (if the break is at LO)
> sed operates only on one line at a lime.  Perl in paragraph mode can
> combine the lines...

Sed does have a way to do things like that with hold and get operations 
across multiple lines, but the syntax is fairly insane compared to perl. 
  And sed is another program where you need to use info instead of man 
for the real documentation - or google for sed and holding space for 
some examples.

   Les Mikesell
    lesmikesell at gmail.com

More information about the K12OSN mailing list