title: Shell Script : How to check if variable is null or no
body: <p>I want to check if variable is null or no.</p>
  
  <p>My code is : </p>
  
  <pre><code>    list_Data="2018-01-15 10:00:00.000|zQfrkkiabiPZ||04|
              2018-01-15 10:00:00.000|zQgKLANvbRWg||04|
              2018-01-15 10:00:00.000|zQgTEbJjWGjf||01|
              2018-01-15 10:00:00.000|zQgwF1YJLnAT||01|"
  
      echo "list_Data"
  
      if [[ -z "list_Data" ]]
      then
      echo "not Empty"
      else
      echo "empty"
      fi
  </code></pre>
  
  <p>The Output is :</p>
  
  <pre><code>2018-01-15 10:00:00.000|zQfrkkiabiPZ||04|
  2018-01-15 10:00:00.000|zQgKLANvbRWg||04|
  2018-01-15 10:00:00.000|zQgTEbJjWGjf||01|
  2018-01-15 10:00:00.000|zQgwF1YJLnAT||01|
  empty
  </code></pre>
  
  <p>The problem that the varible contain values but i have always empty message please help.</p>