title: How to create for-loops with jq in bash
body: <p>I'm trying to split a json file into various json files. The input (r1.json) looks like : </p>
  
  <pre><code> {
  
      "results" : [
  
                  {
              content 1
  }
  ,
  {
              content 2
  }
  ,
  {
              content n
  }
  
      ]
  }
  </code></pre>
  
  <p>I'd like the output to be n files : 1.json, 2.json, n.json. Respectively containing {content 1}, {content 2} and {content n}.</p>
  
  <p>I tried :</p>
  
  <pre><code>for i in {0..24}; do cat r1.json | jq '.results[$i]' &gt;&gt; $i.json; done
  </code></pre>
  
  <p>But I have the following error: error: i is not defined</p>