This is a test version of Biostars. For the public version, visit https://www.biostars.org.
print next line IF statement

Heys,

I'm working with a fasta file with several individuals and I want to split them by a particular coordinate in the genome. I wrote this:

for i in $(cat fasta.file);
do
if [[ $i == *"coordinate"* ]];
then
echo $i AND THE NEXT LINE
fi
done

How can I say to print the next line, that in fact is the bases that I am interested in?

Thanks in advance!!

bash

1 answer

grep -A 1 coordinate fasta.file

?

thanks, easier! I was complicating it too much

Log in to answer this question.