grep and return line continuations?

49 Views Asked by At

I want grep to return results through line continuations, ie input file like:

$ cat input.txt
abba \
  jjjj \
  nnnn

$ grep "abba ?" input.txt
abba jjjj nnnn

I can't seem to get it working.

1

There are 1 best solutions below

1
Mark Setchell On BEST ANSWER

Maybe you are looking for something like this where you search in your file after replacing slashes with newlines...

tr '\\' '\n' < input.txt | grep something