Monday 5 December 2011

Exracting tarball without compression filter options

Exracting tarball without compression filter options

I am writing a script that installs updates to an embedded system.

The script is required to extract a update tarball compressed with either .gz .bz2 or .xz.

I have noticed on my gentoo system that I am able to decompress .tar.gz, .tar.bz2 and tar.xz compressed tarballs with only the -xvf option (ie without specifying the the compression filter -z -j or J options)

My question is: Can this behavior be expected for all versions of tar and will it be safe to assume this behavior if using the format "tar -xvf {*.tar.gz,*.tar.bz2,*.tar.xz}" in my script.

No comments:

Post a Comment