On 2017-02-10 20:47, Hiltjo Posthuma wrote:
On Fri, Feb 10, 2017 at 2:54 PM, yamada yohei <yamadayo...@gmail.com>
wrote:
Why we have to specify -z -j -a -Z or -J when decompress tar ball?
Why doesn't tar distinguish them automatically? (It should achieve
using file(1) or magic(5) database.) I cannot remember all these
options and always use pipeline e.g. bzcat | tar x. I don't sltar to
have these useless options.
Nothing prevents you to write a shellscript wrapper [...]
It could be done with extensions:
case "$1" in
( *.tar.gz ) tar -xzf "$1" ;;
( *.tgz ) tar -xzf "$1" ;;
( *.tar.bz2 ) tar -xjf "$1" ;;
( *.tbz2 ) tar -xjf "$1" ;;
( *.tar ) tar -xf "$1" ;;
esac