The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 10-21-2008
Christoph Spohr Christoph Spohr is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 205
Hi,

try:

sed -n '/^start/,/^end/{/^start\|^end/!{p}}' testfile

where testfile is your file to search and start and end are the strings delimiting your pattern. This command will search every piece of text between a line starting with start and a line starting with end, inside this pattern it will print every line which doesn't start with "start" or "end".

HTH

Chris