Hi there Can anyone hlep me please?
I am using a bash script to look at fasta files output by another script that makes a new consensus sequence from Illumina sequencing data.
I have 2 potential correct expected outcomes, either a new consensus that is 1 fasta sequence, or 8 fasta sequences. If it is anything else I just want to exit the scipt.
So I'm intending to count up the number of > in my fasta file, if the outcome is 1 or 8 then carry on, if its any other number exit.
I'm just not able to make my if statement do what i want, maybe it's just not possible. I've started along these lines
numseqs=$(grep -o ">" "$infile" | wc -l)
if [ "$numseqs" -ne 1 OR 8 ] ; then
echo Number of sequences is NOT 1 or 8
exit
else
echo you have 1 or 8 sequences in your fasta file
carry on and run more commands
fi
After some googling Ive tried -ne 1 OR 8, -ne 1 | 8, -ne 1 || 8, -ne 1 && 8, but i'm pretty lost. Any help please?
Thank you James