Reputation: 75666
I'm trying to remove a few lines matching some regex.
curl <url> | sed '/\(foo\|bar\|baz\)/d'
i don't want any of those lines to show that match foo, bar or baz
it stops on foo
if this is easier with awk, i'm ok with that.
Upvotes: 0
Views: 150
Reputation: 58420
This might work for you (GNU sed):
sed '/foo/{/bar/{/baz/d}}' file
or:
sed '/foo/!b;/bar/!b;/baz/d' file
Upvotes: 0
Reputation: 10915
try
curl <url> | sed '/foo\|bar\|baz/d'
also see many many close examples here: http://www.theunixschool.com/2012/06/sed-25-examples-to-delete-line-or.html
Upvotes: 0