Q: How do I pipe multi-results of first search to search a second file.
Ex:
1) FILE1
system abc{
system ghi{
....
...
2) FILE2
define ABC_1_SUFFIX  0XF67
define ABC_2_SUFFIX  0XF34
define DEF_1_SUFFIX  0XF65
define DEF_2_SUFFIX  0XF11
define GHI_1_SUFFIX  0XF73
define GHI_2_SUFFIX  0XF82  
grep -r "^system" file | awk '{print $2}'   
grep -r "#define.*<result of 1st grep>" file2
Task: How do I pass result of first grep (which is abc,def,ghi against grep -r "^system" ) inside second grep. I know pipe/xargs but cant figure this out yet.
I did search related topic but solution didnt work out.
1] GREP by result of awk
2] grep using grep results
Thanks in advance
 
     
    