title: remove from the string "89dde7.rqsnhq34h.fmu8s1vn0i94hl.tgz.tar.gz" only the ".tar.gz"
body: <p>remove from the string <code>89dde7.rqsnhq34h.fmu8s1vn0i94hl.tgz.tar.gz</code> only the <code>.tar.gz</code> part and the result should be <code>89dde7.rqsnhq34h.fmu8s1vn0i94hl.tgz</code>.
  It can also happen some files with this extension:
  <code>91xhq8vkxlkdfpmfg566qahrwkh01c7n0scpdsr4p4vf6.tbz.tar.bz2</code> and others with double extension tar.tbz tar.zip and so on ...</p>
  
  <p>In case .tar.zip the result must be <code>nomearchivio.tar</code> in the case <code>91xhq8vkxlkdfpmfg566qahrwkh01c7n0scpdsr4p4vf6.tbz.tar.bz2</code> must be <code>91xhq8vkxlkdfpmfg566qahrwkh01c7n0scpdsr4p4vf6.tbz</code></p>
  
  <p>I use this :</p>
  
  <pre><code>nameFile= "89dde7.rqsnhq34h.fmu8s1vn0i94hl.tgz.tar.gz"
  name=${nameFile%.*}
  </code></pre>
  
  <p>and the result is :</p>
  
  <pre><code>echo $name
  89dde7.rqsnhq34h.fmu8s1vn0i94hl.tgz.tar
  </code></pre>
  
  <p>can you help me? Thanks</p>
  
  <p>P.S. note that there are also other points within the file name.</p>