So I'm running my specs and there's an annoying error message that interpolates itself into the output. I don't want to fix the problem that's causing the error message. I just think it would be nice to filter it out using sed or awk or something.
Let's say the error message is this:
I'm an annoying error message that ends in a newline.
And so my experience is something like this:
$ rspec
....f....*.....I'm an annoying error message that ends in a newline.
............................................................I'm an annoying error message that ends in a newline.
....................................................
Whereas the ideal experience would be:
$ rspec | sed something
....f....*....................................................................................................
I've gotten pretty far by doing this:
$ rspec | sed 's/I'"'"'m an annoying error message that ends in a newline.//'
but it leaves a newline everywhere the message would have been. And for some reason tacking on \n
makes it stop matching.
Thanks for reading!
Input
Output