title: If statement syntax error (shell)
body: <pre><code>if [[ ! -z grep echo "${prof}" | cut -d. -f1 dm_smear.dat ]]
  </code></pre>
  
  <p>This gives me the following error. I am trying to find a string <code>${prof}</code> in a file <code>dm_smear.dat</code> and if that exists in the file I will do certain operations</p>
  
  <pre><code>: syntax error in conditional expression   
  : syntax error near `1`'   
  : `         if [[ ! -z grep `echo "${prof}" | cut -d . -f 1` dm_smear.dat ]]'
  </code></pre>