On 2018-01-17 12:49, Adam Carter wrote: > I'm using this to grab a section of text across multiple lines, how do > i get it to exit after the first match? > > awk '/foo/,/bar/'
I don't think I ever tried to match multiple line range. I would do it like this: /foo/ { selecting = 1; } ( selecting == 1 ) { print $0; } /bar/ { if (selecting) exit 0; } -- Please don't Cc: me privately on mailing lists and Usenet, if you also post the followup to the list or newsgroup. To reply privately _only_ on Usenet, fetch the TXT record for the domain.