title: How to check if a specific Character is first in a string read from a file in bash
body: <p>I'm writting a basic installationhelper for my software to install it on a Raspberry Pi. So far, I'm reading which packages I have to install from a textfile line by line. I would like to be able to comment in this file with "#" before a line, so, my installationhelper should check, if there is a "#" as first character of a line, and if so, just show the comment, but ignore the line otherwise. So far, I'm strugling to get it to work as discribed, I feel like I'm missing something small. </p>
  
  <p>My Codesnipet</p>
  
  <pre><code>cat $PATHTOLIBRARIESFILE | while read line; do
      $temp = $line
      if [[ "${a:0:1}" == "#" ]]; then
         echo "$line"
         echo "This is a comment and will be ignored"
      else
         echo "Installing $line..."
         sudo apt-get install $line -y || exit
      fi
  </code></pre>
  
  <p>This is an example of the textfile</p>
  
  <pre><code>#Test1 &lt;--This Line should be ignored for apt-get
  curl
  libboost-all-dev
  libboost-chrono-dev
  libboost-chrono1.49-dev
  libboost-chrono1.49.0
  libboost-date-time-dev
  libboost-date-time1.49-dev
  libboost-date-time1.49.0
  libboost-dev
  #Test2 &lt;--This Line should be ignored for apt-get
  libboost-filesystem-dev
  libboost-filesystem1.49-dev
  libboost-filesystem1.49.0
  libboost-graph-dev
  </code></pre>