I'm try to grep for everything within "test.csv" from the contents on book.1
while IFS= read -r result
do
grep -r $result test.csv >> output.csv
echo $result
done<book1.csv
My book 1 has 1 row of data is column A.
I am getting the results of book1.csv shown on the screen so it is parsing correctly, but I'm getting nothing in the output.csv
I have manually checked the grep & there is contents of book1.csv within the test.csv
What have I done wrong?
EDIT
SAMPLE Input book1.csv
HOSTNAME
TEST1
TEST2
Sample input test.csv
blank,TEST1.abc.123,blank,date
I want to get every line from book1.csv that is in test.csv
Cat -a book1 result
TEST1^M$