|
Re: sed to output blocks , which contain a pattern: msg#00060editors.sed.user
--- In sed-users@xxxxxxxxxxxxxxx, "Siva Senthil Kumaran" <msivask@xxxx> wrote: > > Hi Friends, > > I need a help in using the sed . > > Objective is to search and output the block which contains a pattern > inside > the block. > > > I need to output the block ( from BEGIN to END ) which contains the > pattern > "ccc" in it , hence I need the out put to be > sed -e ' /^BEGIN$/,/^END$/!d /^END$/!{H;/^BEGIN$/h;d;} H;g;/ccc/!d ' yourfile Assuming no whitespaces on your block begin/end lines. ------------------------ Yahoo! Groups Sponsor --------------------~--> 1.2 million kids a year are victims of human trafficking. Stop slavery. http://us.click.yahoo.com/.QUssC/izNLAA/TtwFAA/dkFolB/TM --------------------------------------------------------------------~-> -- Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/sed-users/ <*> To unsubscribe from this group, send an email to: sed-users-unsubscribe@xxxxxxxxxxxxxxx <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/ |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | sed to output blocks , which contain a pattern: 00060, Siva Senthil Kumaran |
|---|---|
| Next by Date: | Bug on GNUWin32 sed 4.1.4: 00060, hq00e |
| Previous by Thread: | sed to output blocks , which contain a patterni: 00060, Siva Senthil Kumaran |
| Next by Thread: | Re: sed to output blocks , which contain a pattern: 00060, hq00e |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |