Afficher un message
Vieux 21/08/2006, 08h45   #3
Troy Piggins
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: awk script to insert blank line between matching patterns

* Rakesh Sharma <sharma__r@hotmail.com> :
>
> Troy Piggins wrote:
> > I'm not too good with awk, but I don't think this can be done
> > with sed.


Apparently not too good with sed either ;-\

> sed -e '


If this can be done with sed then great, but I'll need a little
walk-through on your solution. It's a little above my
current/basic sed knowledge. I've been reading
http://sed.sourceforge.net/sedfaq.html and other resources, but
can't find one that satisfactorily explains what you've done.

> $!N


This adds Next line to the pattern space, but not the last line
of file?

> /^\n/{P;D;}


This matches beginning immediately followed by newline, not sure
what the {P;D;} part is?

> /\n.*signature/!{P;D;}


The word signature here throws me - should it be the sig
delimiter '-- '? Again not sure about {P;D;}?

> s/\n/&&/


&& ?

> '


Thanks for you , just need a little explanation of the above.

--
Troy Piggins
,-o
o ) Ubuntu linux 6.06 http://ubuntu.com RLU#415538 http://counter.li.org
`-o uptime: 17:35:59 up 12 days,10:32,2 users,load average:0.00,0.00,0.00
  Réponse avec citation
 
Page generated in 0,05090 seconds with 9 queries