In my shell script, I am trying to search using the terms found in the source $ file, with the same $ targetfile over and over again.
My $ sourcefile is formatted as such:
pattern1 pattern2 etc...
Inefficient loop that I have to execute with:
for line in $(< $sourcefile);do fgrep $line $targetfile | fgrep "RID" >> $outputfile done
As far as I understand, it would be possible to improve this by loading the entire target target file into memory or, possibly, using AWK?
thanks
source share