title: -bash: [: @: binary operator expected
body: <p>all, </p>
  
  <p>I am checking the error info in a file in the last line, I would like to have a "yes" result if there is an "Error". My shell script is like below:</p>
  
  <pre><code>[ $(tail -1 error.log | grep -E "Error") ] &amp;&amp; echo "yes"
  </code></pre>
  
  <p>then I got the error like above in the title:</p>
  
  <pre><code>-bash: [: @: binary operator expected
  </code></pre>
  
  <p>The error message in the last line is like below:</p>
  
  <pre><code>[aaa,bbb,ccc, Error.ddd @ ]
  </code></pre>
  
  <p>I think that is because of the the Error message, which has [ @ ] format content caused this error. But I do not know how to fix it. Is there any one knows how to process this [ @ ] problem. Thanks very much </p>
  
  <p>@csiu, thanks very much for your quick reply. </p>
  
  <p>The trick here is to use double "[" as below:</p>
  
  <pre><code> [[ $(tail -1 error.log | grep -E "Error") ]] &amp;&amp; echo "yes"
  </code></pre>