Using sed and/or awk, how can do a sed swap on all text in a file until I see a line matching a reg
- by Ross Rogers
How can I do a sed regex swap on all text that preceed a line matching a regex.
e.g. How can I do a swap like this
s/foo/bar/g
for all text that precedes the first point this regex matches:
m/baz/
I don't want to use positive/negative look ahead/behind in my sed regex, because those are really expensive operations on big files.