I am looking for a way to verify the first the characters of an input and once verified continue taking input every three chars. My javascript code is: if (RNA.substring(0,3) != 'AUG') {
alert('You did not start with the first AUG codon!');
}
if (RNA.substring(0,3) == 'AUG') {
result.push('M/Start');
}
for (i=0;i<=100;i++) {
if (RNA.substring(start,stop) == '"B"') {
result.push('B');
var start = start+3;
var stop = stop+3;
}
so I need a similar way to do this in bash. I know how to do a for loop but I do not know how to take input in three characters at a time.
Any help is appreciated as I am pretty new to Bash.
Thanks in advance!