title: bash: how to check if a string starts with '#'?
body: <p>In bash I need to check if a string starts with '#' sign. How do I do that?</p>
  
  <p>This is my take --</p>
  
  <pre><code>if [[ $line =~ '#*' ]]; then
      echo "$line starts with #" ;
  fi
  </code></pre>
  
  <p>I want to run this script over a file, the file looks like this --</p>
  
  <pre><code>03930
  #90329
  43929
  #39839
  </code></pre>
  
  <p>and this is my script --</p>
  
  <pre><code>while read line ; do
      if [[ $line =~ '#*' ]]; then
          echo "$line starts with #" ;
      fi
  done &lt; data.in
  </code></pre>
  
  <p>and this is my expected output --</p>
  
  <pre><code>#90329 starts with #
  #39839 starts with #
  </code></pre>
  
  <p>But I could not make it work, any idea?</p>