So I want to use grep with variables I'd be picking from a text file (one per line). I've tried different commands for grep and it's not working... I've seen also similar questions, but anything seems to be working? Any help would be much appreciated, thanks. Below my attempt, manually assigning the variable hey grep works, but not if I attempt to take the variable from the ids.txt file
Thank you very much!
$ head ids.txt
Nitab4.5_0005105
Nitab4.5_0007510
Nitab4.5_0001604
$ for i in $(cat ids.txt); do grep -A1 "$i" seqs.fasta; done
$ hey="Nitab4.5_0001604"
$ grep -A1 "$hey" seqs.fasta
>Nitab4.5_0001604
ATGTCATGCATTTTTTAAAANNNNNNNNNNNA