1 |
On Wed, Jan 17, 2018 at 6:16 PM, Alexander Kapshuk < |
2 |
alexander.kapshuk@×××××.com> wrote: |
3 |
|
4 |
> On Wed, Jan 17, 2018 at 3:49 AM, Adam Carter <adamcarter3@×××××.com> |
5 |
> wrote: |
6 |
> > I'm using this to grab a section of text across multiple lines, how do i |
7 |
> get |
8 |
> > it to exit after the first match? |
9 |
> > |
10 |
> > awk '/foo/,/bar/' |
11 |
> |
12 |
> See if this works for you: |
13 |
> awk '/foo/,/bar/{print;if(/bar/)exit}' file |
14 |
> sed '/foo/,/bar/!d;/bar/q' file |
15 |
> |
16 |
> The awk line works. I didnt try the sed line. Thanks! |