On 1/21/07, James Rosten <seinfeld90@gmail.com> wrote:
* Johannes Weiner <hannes@saeurebad.de> [070121 13:38]:
What about this:
case $file_type in "application/x-tar") ft=".tar";; "application/x-tar*") case $file_type in "*x-gzip") ft=".tgz";; "*x-bzip2") ft=".tbz2";; ecac;; "application/x-zip*") ft=".zip";; [...] esac
This would save a lot of external calls to grep ;)
Good idea. I've got the new patch below as usual.
One curiosity here: More modern version of tar is able to pick up the proper decompression program with a simple -xf (try -xf on a bz2 or gz file). Wouldn't it be best to just match application/x-tar* to tar -xf?