title: bash/shell jq parse to variable from aws json
body: <p>I am trying to parse json result from aws result, but I getting error or null when I am using $ip, when I am using specific IP it work. something wrong when I am using tne variable inside the jq command </p>
  
  <pre><code>#!/bin/bash
  
  aws ec2 describe-addresses --region eu-west-1 &gt; 1.txt
  ipList=( "52.16.121.238" "52.17.250.188" )
  
  for ip in "${ipList[@]}";
  do
      echo $ip
      cat 1.txt | jq '.Addresses | .[] | select (.PublicIp==$ip) |    .InstanceId'
      #echo $result
  done
  </code></pre>
  
  <p>Please advise.</p>