title: Need nested loop to print values from two array in ruby
body: <p>I have two arrays</p>
  
  <pre><code>ids = ["10.12.14","10.12.15"]
  iq = ["abc","pqr"]
  </code></pre>
  
  <p>I want o/p in below format</p>
  
  <pre><code>New-IscsiTargetPortal -TargetPortalAddress 10.12.14
  New-IscsiTargetPortal -TargetPortalAddress 10.12.15
  Connect-IscsiTarget -NodeAddress abc -TargetPortalAddress 10.12.14 -IsPersistent $True
  Connect-IscsiTarget -NodeAddress xyz -TargetPortalAddress 10.12.15 -IsPersistent $True
  </code></pre>
  
  <p>My code looks like </p>
  
  <pre><code>for i in ids
    for j in iq
      puts "New-IscsiTargetPortal -TargetPortalAddress #{i}"
      puts "Connect-IscsiTarget -NodeAddress #{j} -TargetPortalAddress #{i} -IsPersistent $True"
    end
  end
  </code></pre>
  
  <p>But it is duplicating values for i and j:</p>
  
  <pre><code>New-IscsiTargetPortal -TargetPortalAddress 10.12.14
  Connect-IscsiTarget -NodeAddress abc -TargetPortalAddress 10.12.14 -IsPersistent $True
  New-IscsiTargetPortal -TargetPortalAddress 10.12.14
  Connect-IscsiTarget -NodeAddress pqr -TargetPortalAddress 10.12.14 -IsPersistent $True
  New-IscsiTargetPortal -TargetPortalAddress 10.12.15
  Connect-IscsiTarget -NodeAddress abc -TargetPortalAddress 10.12.15 -IsPersistent $True
  New-IscsiTargetPortal -TargetPortalAddress 10.12.15
  Connect-IscsiTarget -NodeAddress pqr -TargetPortalAddress 10.12.15 -IsPersistent $True
  </code></pre>
  
  <p>Can you please help me in nested for loop or how i can get desired o/p?</p>