I have a file xyz with the following content
PPPL 0123
PPPL 0006
POFT 0923
POFT 1111
WENT 2323
SEND 2345
I also have another file named MasterFile where it contains the above mentioned data million times with different digits at the end for example some times it contains SEND 9999 or WENT 9898 or POFT 7898
Sample MasterFile
Some Data Before the Search String PPPL 0123 Some Data after the search String
Some Data Before the Search String PPPL 9999 Some Data after the search String
Some Data Before the Search String PPPL 8888 Some Data after the search String
Some Data Before the Search String PPPL 0006 Some Data after the search String
Some Data Before the Search String PPPL 7779 Some Data after the search String
Some Data Before the Search String POFT 0923 Some Data after the search String
Some Data Before the Search String POFT 9999 Some Data after the search String
Some Data Before the Search String POFT 8828 Some Data after the search String
Some Data Before the Search String POFT 1111 Some Data after the search String
Some Data Before the Search String WENT 2323 Some Data after the search String
Some Data Before the Search String WENT 9898 Some Data after the search String
Some Data Before the Search String WENT 9999 Some Data after the search String
Some Data Before the Search String SEND 2345 Some Data after the search String
Some Data Before the Search String SEND 6666 Some Data after the search String
Some Data Before the Search String SEND 7777 Some Data after the search String
I am writing my script as the following
for i in `cat xyz`
do
grep "$i" MasterFile >> FoundString
done
even when I put the double quotes around
$i
it doesnt work Can I get some help please