title: Bash: get result from 1 loop independent from 2
body: <p>I have some question about using loops in the bash script. I need to send multiple POST request with different values. So I used the loops.
  In 1 loops I change the name of profile just add to it the number from 1 to 500</p>
  
  <pre><code>#!/bin/bash
  token="Authorization: Bearer h-bCxY3nCJD_Oro_aQE15soo-XFewv1bzsArbd46iJrH1t5Fxa3TLYaQ3Q"
  url="http://ad44fcfa01aad11e98c201.amazonaws.com/api/v0.1/scanprofiles"
  q=500
  
  name=3_Ubuntu_internal
  
  for ((i = 0; i &lt; q; i++))
   do
      data='{"target":{"scan_type":"internal","ip_range":"10.142.0.2-10.142.0.5","ports":"1042"},"name":"'$name$i'","run_immediately":"False"}'
      echo "${data}"
      curl -X POST $url -H 'Content-Type: application/json' -H "$token" -d "$data"
   done
  </code></pre>
  
  <p>And it works, creates 500 profile with default parameters of IP and ports. But then I need to change default ports from 1042 to one from the array from 1042 to 1237. I try to create another one loop inside of existing but get not exactly that results what I want. A.e. for each from 500 profiles applying firstly 1042 port, then 1043 and so on. And I want to create profile 1 with 1042 port, profile 2 - 1043 and so on. Of course the number of profiles more the number of ports from 1042 to 1237 but it's OK, ports can be repeated again</p>