title: While loop with nested for loop
body: <p>I need help with bash script.
  So I have input data as</p>
  
  <pre><code>CellIden="461"
  CellIden="465"
  CellIden="468"
  CellIden="462"
  CellIden="466"
  CellIden="469"
  CellIden="463"
  CellIden="467"
  CellIden="460"
  </code></pre>
  
  <p>and I have created while loop </p>
  
  <pre><code>cat FolderCell2 | while read line ;
  do
  echo $line | sed -e 's/cellIden/Cell/g'
  done &gt; FolderCell3
  </code></pre>
  
  <p>so this will read each line and replace strings, but I need two more loops in this while script :</p>
  
  <pre><code>for (( i = 1; i &lt;=$SEC_NUM ; i++ ))
  do
  for (( j = 1 ; j &lt;=$Cell_Num ; j++ ))
  do
  sed -e 's/Cell/Cell$i$j/g'
  done
  done &gt; File
  </code></pre>
  
  <p>the ouput shold be like this </p>
  
  <pre><code>Cell11="461"
  Cell12="465"
  Cell13="468"
  Cell21="462"
  Cell22="466"
  Cell23="469"
  Cell31="463"
  Cell32="467"
  Cell33="460"
  </code></pre>
  
  <p>Variables $SEC_NUM and $Cell_Num are sometimes different. So I don't know how to combine this two codes, <code>while loop</code> together with <code>two for loop</code> to get ouput as this above.</p>