I've been picking up Bash lately and I'm having trouble wrapping my head around nested loops.

Here's what I got.

```
input='ATAATAATAATG'
CODONTABLE=(ATA I ATC I ATT I ATG M ACA T
            ACC T ACG T ACT T AAC N AAT N
            AAA K AAG K AGC S AGT S AGA R
            AGG R CTA L CTC L CTG L CTT L
            CCA P CCC P CCG P CCT P CAC H
            CAT H CAA Q CAG Q CGA R CGC R
            CGG R CGT R GTA V GTC V GTG V
            GTT V GCA A GCC A GCG A GCT A
            GAC D GAT D GAA E GAG E GGA G
            GGC G GGG G GGT G TCA S TCC S
            TCG S TCT S TTC F TTT F TTA L
            TTG L TAC Y TAT Y TAA _ TAG _
            TGC C TGT C TGA _ TGG W)

for ((i=0;i<${#input};i++)) ; do
  let w+=1
  for c in $input ; do
    for h in $CODONTABLE ; do
      if [ $(echo ${input:x:3})=$(echo $CODONTABLE[w]) ] ; then
      mod+=(${CODONTABLE[w]})
      let x+=1
      else
      let w+=1
      fi
    done
  done
done
echo $mod
echo $input

```

What I get from this is...

```
ATAATAATAATG
I

```

So it seems that at least ATA was properly translated into an I.
However, what I want is 

```
**ATA**ATAATAATG -> I
A**TAA**TAATAATG -> _
AT**AAT**AATAATG -> N
ATA**ATA**ATAATG -> I

```

So that the final output reads `I_NI_NI_NM`, which I use later.

In short, how do I create a proper repeating loop that goes through my input, translates every possible 3 character frame, and appends this to another array?