Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

11
  • if filename=abc.pdf and otherfile=def.pdf, I have used the following command grep -f <(awk '{print $1 "\n" $3}' abc.pdf) def.pdf but getting error saying: grep: Unmatched [ or [^ @Eric Renouf Commented Sep 13, 2015 at 15:05
  • @Black that probably means the strings being returned from awk are things that look like regular expressions to grep. You can add the -F flag to grep to tell it not to interpret the strings as regex, instead they are Fixed strings Commented Sep 13, 2015 at 16:29
  • what will be the final shell command if I want to use this in pipeline with the command I stated at last in my post? @Eric Renouf Commented Sep 13, 2015 at 16:31
  • @Black see my latest update Commented Sep 13, 2015 at 16:34
  • according to you will I apply awk on input first? But I wanted to use the two return values from pdftotext 'filename.pdf' - | grep 'pattern' | awk '{ print $1, "\t"$2 }' to use again (2nd time) as patterns after grep in pipeline with this same command @Eric Renouf Commented Sep 13, 2015 at 16:45