sed question

Mark Winsor wmark at wb3ffv.ampr.org
Thu May 16 08:33:23 AEST 1991


I know that 

sed -n '/PATTERN1/,/PATTERN2/p' filename

will print everything between pattern 1 & 2, but what if I only want the
first occurence of these patterns in the file? I know I can pipe the above
statement to sed '/PATTERN2/q' but there has got to be a way to do this
in one sed process. Thanks.

Mark S. Winsor
ProVAR, Inc.



More information about the Comp.unix.shell mailing list