How do I pipe the output of grep as the search pattern for another grep?
As an example:
grep | xargs grep
You should grep in such a way, to extract filenames only, see the parameter -l (the lowercase L):
grep -l someSearch * | xargs grep otherSearch
Because on the simple grep, the output is much more info than file names only. For instance when you do
grep someSearch *
You will pipe to xargs info like this
filename1: blablabla someSearch blablabla something else
filename2: bla someSearch bla otherSearch
...
Piping any of above line makes nonsense to pass to xargs. But when you do grep -l someSearch *, your output will look like this:
filename1
filename2
Such an output can be passed now to xargs