How do I pipe the output of grep as the search pattern for another grep?
As an example:
grep | xargs grep
I wanted to search for text in files (using grep) that had a certain pattern in their file names (found using find) in the current directory. I used the following command:
grep -i "pattern1" $(find . -name "pattern2")
Here pattern2 is the pattern in the file names and pattern1 is the pattern searched for within files matching pattern2.
edit: Not strictly piping but still related and quite useful...