The UNIX and Linux Forums  

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 -->
  #3 (permalink)  
Old 02-27-2008
sank sank is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 24
Hi,

thanks for the reply. It works fine when pattern1 and pattern2 are totally different. In some cases, pattern2 will be a part of pattern1 and in this case, it will just print the pattern1 and exits. how can we avoid this ?

Also, pattern2 can occur ( multiple times ) before pattern1 itself since it can pair up with other patterns to form a different range. so, how can we modify the command so that "-e '/pattern2/q' " part is effective only if the search is in the range ?

thanks again,
sank.