title: BASH for loop multiple arrays
body: <p>I am trying to pull info from multiple arrays and then echo it out. Unfortunately, I am having some trouble and I am almost positive it is something wrong with my for loop structure.</p>
  
  <p>Lets assume:</p>
  
  <pre><code>array1= 1, 2, 3
  array2= toronto, new york, paris
  </code></pre>
  
  <p>The code that I currently have:</p>
  
  <pre><code>for element in "${array1[@]}" "${array2[@]}"
  do
  echo ""$element" "element""
  done
  </code></pre>
  
  <p>The output looks something like this:</p>
  
  <pre><code>1 1
  2 2
  3 3
  toronto toronto
  new york new york
  paris paris
  </code></pre>
  
  <p>Now this obviously doesn't work because it outputs the same thing twice in each array. So, I tried to use a for loop within a for loop but then I have multiples.</p>
  
  <p>How would I setup the for loop so my output looks like this:</p>
  
  <pre><code>1 toronto
  2 new york
  3 paris
  </code></pre>