title: Passing bash variable to jq
body: <p>I have written a script to retrieve certain value from <code>file.json</code>. It works if I provide the value to jq <code>select</code>, but the variable doesn't seem to work (or I don't know how to use it).</p>
  
  <pre><code>#!/bin/sh
  
  #this works ***
  projectID=$(cat file.json | jq -r '.resource[] | select(.username=="myemail@hotmail.com") | .id')
  echo "$projectID"
  
  EMAILID=myemail@hotmail.com
  
  #this does not work *** no value is printed
  projectID=$(cat file.json | jq -r '.resource[] | select(.username=="$EMAILID") | .id')
  echo "$projectID"
  </code></pre>