title: Passing bash shell variable to jq filter
body: <p>Trying to pass a bash shell variable into a jq filter</p>
  
  <p>JSON:</p>
  
  <pre><code>{
  "server1": {
  "port": 3333,
  "name": "foo",
  "timesincelast": 248054
  },
  "server2": {
  "port": 4444,
  "name": "bar",
  "timesincelast": 248054
    }
    }
  </code></pre>
  
  <p>Bash command trying to execute:</p>
  
  <pre><code> servername='server1'
   jq --arg servername "$servername" '.$servername .port'
  </code></pre>
  
  <p>But getting an error</p>
  
  <pre><code> jq: error: syntax error, unexpected '$' (Unix shell quoting issues?) at 
  &lt;top-level&gt;, line 1:
  </code></pre>
  
  <p>But direct substitution works </p>
  
  <pre><code>jq '.server1 .port'
  </code></pre>