title: Check shell variable failing when it returns null list
body: <p><strong>Objective:</strong> Trying to check if resource exist on azure with bash script</p>
  <p><strong>Code that I use :</strong></p>
  <pre><code>status=$(az group list --query &quot;[?name.contains(@,'test')]&quot;)
  if [[ &quot;$status&quot; == null ]];
  then
     echo &quot;not exist&quot;
  else
     echo &quot;exist&quot;
  fi
  </code></pre>
  <p>I have this resource in azure i.e it should return as &quot;exist&quot; however its says not exist
  If I change to a non existant resource group name then time also its gives not exist.</p>
  <p>do you see any syntax issue here ?</p>
  <p>Instead of script if I execute at commmand line to check , below are results</p>
  <pre><code>user@ablab:~$ status=$(az group list --query &quot;[?name.contains(@,'abcd')]&quot;)
  user@ablab:~$ echo $status
  []
  user@ablab:~$ status=$(az group list --query &quot;[?name.contains(@,'test')]&quot;)
  user@ablab:~$ echo $status
  [ { &quot;id&quot;: &quot;/subscriptions/xxxx-xxxx-xxx--xxxxx3/resourceGroups/test1&quot;, &quot;location&quot;: &quot;westeurope&quot;, &quot;managedBy&quot;: null, &quot;name&quot;: &quot;test1&quot;, &quot;properties&quot;: { &quot;provisioningState&quot;: &quot;Succeeded&quot; }, &quot;tags&quot;: null, &quot;type&quot;: &quot;Microsoft.Resources/resourceGroups&quot; } ]
  </code></pre>
  <p>Now I wanna use if condition, so that if its exist it should process set of flow else set of code..</p>
  <p>Please let me know what wrong with my if statement.</p>