title: BASH: loop array values unlimited
body: <p>In bash I want array let say:</p>
  <pre><code>array=(1 2 3)
  </code></pre>
  <p>Then I need a loop for program where</p>
  <p>x will be 1,2,3,1,2,3... (from array)</p>
  <p>i will be unlimited 1,2,3,4,5,6.... (main loop)</p>
  <p>My code:</p>
  <pre><code>array=(1 2 3)
  while true ; do
   ((i=i+1))
   #screen -dmS plot$i -d /destinatin$x
   echo $i $x
   sleep 1
  done
  </code></pre>
  <p>I do not know how to loop array and set $x to go 1,2,3,1,2,3....</p>