title: Exporting JSON to environment variables
body: <p>If I have a JSON like this,</p>
  <pre><code>{
      &quot;hello1&quot;: &quot;world1&quot;,
      &quot;testk&quot;: &quot;testv&quot;
  }
  </code></pre>
  <p>And I want to export each of these key-value pairs as environment variables, how to do it via shell script? So for example, when I write on the terminal, <code>echo $hello1</code>, <code>world1</code> should be printed and similarly for other key-value pairs?
  Note: The above JSON is present in a variable called <code>$values</code> and not in a file.</p>
  <p>I know it will be done via <code>jq</code> and written a shell script for this, but it doesn't work.</p>
  <pre><code>for row in $(echo &quot;${values}&quot; | jq -r '.[]'); do
      -jq() {
          echo ${row} | jq -r ${1}
      }
      echo $(_jq '.samplekey')
  done
  </code></pre>