title: using jq select operation on json arrays
body: <p>I have 2 json arrays: data1 and data2. 
  I'm trying to merge the 2 json arrays into one json, using jq.
  for this: I'm fetching the shared property "region" from the data1, and trying to find the matching one in data2.
  Yet, jq's select fails to work with the parameter I pass, but it does work with any specific value.</p>
  
  <pre><code>data1='[ 
   {"domain": "domain1", "region": "region1"}, {"domain": "domain2","region": "region2"}, { "domain": "domain3", "region": "region3"} ]'
  
  data2='[ 
   {"region": "eustaging1", "secret": "s1"}, {"region": "eustaging2", "secret": "s2"}, { "region": "eustaging2", "secret": "s3"}]'
  
  for k in $(jq -c '.[]' &lt;&lt;&lt; "$data1"); do
      crgn=$(jq '.region' &lt;&lt;&lt; $k)
      # select with parameter not working :(
      matching_obj=$(jq -c  '.[] | select(.region=="$crgn") ' &lt;&lt;&lt; "$data2")
      echo "current region is $crgn" 
      echo "matching object is $matching_obj"
  done
  </code></pre>
  
  <p>output:</p>
  
  <pre><code> current region is "region1"
   matching object is
   current region is "region2"
   matching object is
   current region is "region3"
   matching object is
  </code></pre>