title: jq: Select range
body: <p>TL;DR: Given an input file with a series of keypairs, I want to select the 3rd-to-last and 4th-to-last pairs. I can get them individually, but I want to grab both at once if possible. Can this be done?</p>
  
  <p>My input file is structured like this;</p>
  
  <pre><code>[
   {
    "foo": "bar",
    "foo2": "bar2"
   },
   {
    "foo3": "bar3",
    "foo4": "bar4"
   },
   {
    "foo5": "bar5",
    "foo6": "bar6"
   },
   {
    "foo7": "bar7",
    "foo8": "bar8"
   },
   {
    "foo9": "bar9",
    "foo10": "bar10"
   }
  ]
  </code></pre>
  
  <p>And my output should be</p>
  
  <pre><code>[ 
   {
    "foo3": "bar3",
    "foo4": "bar4"
   },
   {
    "foo5": "bar5",
    "foo6": "bar6"
   }
  ]
  </code></pre>
  
  <p>I know I can do <code>jq -s '.[-3]'</code> to get the 3rd-to-last (and swap with a 4 for the 4th-to-last) but that grabs them separately. </p>
  
  <p>I thought from the documentation that <code>jq -s '.[-3;-4]'</code> would grab both but that throws an error.</p>
  
  <p>I could grab them individually and work on each separately but that's sloppy code. Is there a cleaner way to grab both at once?</p>