title: Escaping Shebang in grep
body: <p>in a shell script, i'm trying to find out if another file is a shell script. i'm doing that by grepping the shebang line. but my grep statement doesn't work:</p>
  
  <pre><code>if [[ $($(cat $file) | grep '^#! /bin' | wc -l) -gt 0 ]]
  then 
  echo 'file is a script!'
  else 
  echo "no script"
  fi
  </code></pre>
  
  <p>i always get the error <code>"bash: #!: command not found"</code>. i tried several things to escape the shebang but that didn't work.</p>
  
  <p>maybe you can help me with that? :)</p>
  
  <p>cheers,
  narf</p>