title: Errors in bash script. Syntax error near unexpected token
body: <p>Do you know what is wrong with my script as I always get the error mesage:</p>
  
  <pre><code>position frac1 frac2
  : command not found: 
  '/s1_met.sh: line 3: syntax error near unexpected token `do
  '/s1_met.sh: line 3: `for lineF1 in $(cat $1); do
  </code></pre>
  
  <p>Code here:</p>
  
  <pre><code>export IFS=$'\n'
  echo "position frac1 frac2";  
  for lineF1 in $(cat $1); do
      if [ $(echo $lineF1 | cut -b 1-2) = "##" ]; then
         echo "skip line" &gt;&amp;2;
      else
         startF1=$(echo $lineF1 | cut -f 4);
         stopF1=$(echo $lineF1 | cut -f 5);
         fracF1=$(echo $lineF1 | cut -f 9 | cut -d ";" -f 4 | cut -d "=" -f 2);
  
         lineF2=$(grep "$startF1" $2);
         if [ -z "$lineF2" ]; then
            echo "position $startF1 cannot be found" &gt;&amp;2;
         else
            fracF2=$(echo $lineF2 | cut -f 9 | cut -d ";" -f 4 | cut -d "=" -f 2);
            echo "$startF1 $fracF1 $fracF2";
         fi;
      fi
  done;
  </code></pre>