Find the answer to your Linux question:
Results 1 to 2 of 2
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 ...
  1. #1
    Just Joined! RobertF's Avatar
    Join Date
    Feb 2008
    Location
    Cape Town
    Posts
    12

    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.

  2. #2
    Linux Newbie
    Join Date
    Mar 2010
    Posts
    121
    No - particularly on embedded devices. For example, the busybox tar implementation commonly used does not behave this way (at least the two versions we use at work).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...