Hi -
In my shell script, I am trying to search using terms found in a $sourcefile against the same $targetfile over and over.
My $sourcefile is formatted as such:
pattern1
pattern2
etc...
The inefficient loop I have to search with is:
for line in $(< $sourcefile);do
fgrep $line $targetfile | fgrep "RID" >> $outputfile
done
I understand it would be possible to improve this by either loading the whole $targetfile into memory, or perhaps by using AWK?
Thanks