title: Extract substring before dot
body: <p>I try to substract the first string before a <code>dot</code> (<code>.</code>) in bash. </p>
  
  <p>For instance: </p>
  
  <pre><code>1.2.3 -&gt; 1
  11.4.1 -&gt; 11
  </code></pre>
  
  <p>I used the following command based on the <a href="http://tldp.org/LDP/abs/html/string-manipulation.html" rel="noreferrer">docs</a>:</p>
  
  <pre><code>s=4.5.0
  echo "${s%.*}"
  </code></pre>
  
  <p>But it ouptuts <code>4.5</code> instead of <code>4</code>. I don't get it. </p>
  
  <p>Why is that?</p>