0

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.

user318904
  • 2,968
  • 4
  • 28
  • 37

1 Answers1

1

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
Mark Setchell
  • 191,897
  • 31
  • 273
  • 432
  • Selecting this as the answer. I ended up doing something like this-- but there is probably a better solution. – user318904 Jun 22 '15 at 21:14