I have a for loop that loops over a few lines. each line has two strings with a tab separating them e.g
chr11 105804693
when I pass the variable to grep with a file to search in it returns "105804693: No such file or directory"
. my code looks like this:
for line in $(cat list_of_lines); do grep $line file_to_search_in >> output_file; done
I tried to printf
the variable and it returned "chr11"
but when I echoed the variable it returned "chr11 105804693"
How can I call grep on the variable and have it search for the full line?