i have a file that has multiple names in it named names.txt. the file contents are as follows
"james spader"
"james tidwell"
"brian stern"
"rachel thurston"
"bob denver"
"todd greenberg"
how would i grep a different file for the names within names.txt
here is the command i have but it greps the file for every instance of james, spader, james, tidwell, brian, stern, and not the full name (i.e. "james spader" "james tidwell" "brian stern" etc.)
Code:
for i in `cat names.txt`; do grep -i $i names_two.txt; done