title: Extract a specific field from JSON output using jq
body: <p>I have a JSON output as follows:</p>
  
  <pre><code>{
    "example": {
      "sub-example": [
        {
          "name": "123-345",
          "tag" : 100
        },
        {
          "name": "234-456",
          "tag" : 100
        },
        {
          "name": "4a7-a07a5",
          "tag" : 100
        }
      ]
    }
  }
  </code></pre>
  
  <p>I want to extract the values of the three "name" fields and store it in three variables.</p>
  
  <p>I tried <code>cat json_file | jq '.["example.sub-example.name"]'</code> to extract the value of the "name" field but that doesn't work.</p>
  
  <p>Can anyone tell me how to achieve this using jq (or some other method)?</p>