Quote:
|
grep `cat filea` fileb > filec
|
You were on the right track.
Use the -f flag with grep to pass in a list of patterns from a file.
e.g.
grep -f filea fileb > filec
Just so you understand why your effort wouldn't work...
`cat filea` would expand to for example:
customer1
customer2
customer3
... your grep command would therefore be interpreted by the shell as being:
grep customer1 customer2 customer3 fileb > filec
The above would look for the pattern "customer1" in the files "customer2", "customer3" and "fileb". The output would be redirected to "filec". You would get errors in filec because the files you have stipulated do not exist.
HTH