title: Remove all text from last dot in bash
body: <p>I have a file named <code>test.txt</code> which has:</p>
  
  <pre><code>abc.cde.ccd.eed.12345.5678.txt
  abcd.cdde.ccdd.eaed.12346.5688.txt
  aabc.cade.cacd.eaed.13345.5078.txt
  abzc.cdae.ccda.eaed.29345.1678.txt
  abac.cdae.cacd.eead.18145.2678.txt
  aabc.cdve.cncd.ened.19945.2345.txt
  </code></pre>
  
  <p>If I want to remove everything beyond the first <code>.</code> like:</p>
  
  <pre><code>cde.ccd.eed.12345.5678.txt
  cdde.ccdd.eaed.12346.5688.txt
  cade.cacd.eaed.13345.5078.txt
  cdae.ccda.eaed.29345.1678.txt
  cdae.cacd.eead.18145.2678.txt
  cdve.cncd.ened.19945.2345.txt
  </code></pre>
  
  <p>Then I will do</p>
  
  <pre><code>for i in `cat test.txt`; do echo ${i#*.}; done
  </code></pre>
  
  <p>but If I want to remove everything after the last <code>.</code> like:</p>
  
  <pre><code>abc.cde.ccd.eed.12345.5678
  abcd.cdde.ccdd.eaed.12346.5688
  aabc.cade.cacd.eaed.13345.5078
  abzc.cdae.ccda.eaed.29345.1678
  abac.cdae.cacd.eead.18145.2678
  aabc.cdve.cncd.ened.19945.2345
  </code></pre>
  
  <p>what should I do?</p>