I have some problem with grep. I wrote a script which need to find some numbers from a list (file name ContigsNames) in a database. I wrote the following script:
file=ContigsNames while IFS=' ' read -r f1 f2 do grep '$f1' /data/databases/fasta/lizih/metagenemark_predictions.faa #grep 1703496 /data/databases/fasta/lizih/metagenemark_predictions.faa done < "$file"
As a check I enter a grep line with specific number which is in the list and it works great! so seems like it has some problem with the '$f1'. When I'm doing echo "$f1", it printed the right numbers with no problems.
What might be the problem? Might it be related to 'string' type instead of number?