title: Loop through json using jq to get multiple value
body: <p>Here is volumes.json :</p>
  
  <pre><code>{
  "Volumes": [
      {
          "AvailabilityZone": "us-east-1a",
          "Tags": [
              {
                  "Value": "vol-rescue-system",
                  "Key": "Name"
              }
          ],
          "VolumeId": "vol-00112233",
      },
      {
          "AvailabilityZone": "us-east-1a",
          "Tags": [
              {
                  "Value": "vol-rescue-swap",
                  "Key": "Name"
              }
          ],
          "VolumeId": "vol-00112234",
      },
      {
          "AvailabilityZone": "us-east-1a",
          "Tags": [
              {
                  "Value": "vol-rescue-storage",
                  "Key": "Name"
              }
          ],
          "VolumeId": "vol-00112235",
      }
  ]
  }
  </code></pre>
  
  <p>I need to get both the value of <code>VolumeId</code> and <code>Tags.Value</code> to be used as the input to invoke another command. It is easy to get a single value from the json array, but I am not able to extract <strong>multiple value</strong> from it and pass it to another bash command. </p>
  
  <p>I can get a single value using this:</p>
  
  <pre><code>cat volumes.json |jq -r '.Volumes[].VolumeId' |while read v; do another_bash_command $v; done
  </code></pre>
  
  <p>but I am not able to get multiple value cause this is wrong:</p>
  
  <pre><code> cat volumes.json |jq -r '.Volumes[].VolumeId, .Volumes[].Tags[].Value' |while read v w; do another_bash_command $v $w; done
  </code></pre>
  
  <p>as it will then loop 6 times of the outcome instead of 3.</p>
  
  <p><strong>And</strong>, how do I pass those multiple json value in the loop to a bash array so I can use the value in a better way ? Like <code>VolumeId-&gt; $arr[0][0]</code>, <code>Tags.Value-&gt; $arr[0][1]</code>, <code>AvailabilityZone-&gt; $arr[0][2]</code>...etc.  I have searched through SO and the jq docs, and tried <code>readarray</code>, but still not able to find out the solution :( Thanks for any help given. </p>