title: Get a specific number from a line and append it
body: <p>I am trying to filter a specific line of my file, <strong>to only get the number from it</strong>.</p>
  
  <p>My file is locate in, /home/evaluation/<strong>studentName</strong>, and contains this :</p>
  
  <ul>
  <li>English 18</li>
  <li>History 18</li>
  <li>Math 18</li>
  <li>Total : 90/100</li>
  </ul>
  
  <p>But could also contains this :</p>
  
  <ul>
  <li>Enlgish 14</li>
  <li>History 14</li>
  <li>Total : 70/100</li>
  </ul>
  
  <p>So each student has its own marks.</p>
  
  <hr>
  
  <p>I'd like to filter the <strong>total</strong> number only.
  So it will show : <strong>90</strong> or <strong>70</strong>.</p>
  
  <p>And then simply append that number inside of the student file.</p>
  
  <hr>
  
  <p><strong>So far I went to this</strong> :</p>
  
  <pre><code>for file in /home/evaluation/* ; do
      awk -v tot="$tot" '{sum+=$2} END {print "Total", (sum/(tot*20))*100"/100"}' "$file" &gt;&gt; "$file"
  result=$(grep "Total" "$file" | cut d' ' -f2)
  echo "$result" &gt;&gt; $file
  done
  </code></pre>
  
  <p>But it doesn't work unfortunately.</p>