How to untar .tar.gz when you don't have "-z" option? - Unix

This is a discussion on How to untar .tar.gz when you don't have "-z" option? - Unix ; Dave Hinz wrote: > > > ls -l /home/me/web/tools/app_10242005.tar* > > /home/me/web/tools/app_10242005.tar > > ...and yet it uncompressed. Did you ever answer the question someone > else asked about if you're in a chroot jail? No, because I'm not a ...

+ Reply to Thread
Page 3 of 3 FirstFirst 1 2 3
Results 41 to 47 of 47

Thread: How to untar .tar.gz when you don't have "-z" option?

  1. Re: How to untar .tar.gz when you don't have "-z" option?


    Dave Hinz wrote:

    >
    > > ls -l /home/me/web/tools/app_10242005.tar*
    > > /home/me/web/tools/app_10242005.tar

    >
    > ...and yet it uncompressed. Did you ever answer the question someone
    > else asked about if you're in a chroot jail?


    No, because I'm not a system admin, not an enginner, not a UNIX guru.
    I'm a Web guy, PHP/TCL/ASP/JSP web application guy. In spite of
    researching and reading
    http://www.bpfh.net/simes/computing/chroot-break.html (which made
    absolutely no sense to me whatsoever), I couldn't and still cannot
    answer that question and proceeded on a different route: I called the
    hosting provider and simply asked him how he would untar a compressed
    tarball. He told me "gtar" because he uses GNU tar.

    I tried it and it worked perfectly for me, so that's that.

    Here's the code:

    [BASH]
    # SYNTAX: unpack $path $origPath $origName $today (as $1 $2 $3 $4)
    unpack()
    {
    cd $1; # GO TO PATH
    hasGtar=`which gtar | grep -E 'no gtar'`; # CHECK TO SEE IF gtar IS
    AVAILABLE HERE
    hasGunzip=`which gunzip | grep -E 'no gunzip'`; # CHECK TO SEE IF
    gunzip IS AVAILABLE HERE
    if [ -n $hasGtar ]; then
    gtar -zxvf "$1/$3_$4.tar.gz"
    elif [ -n $hasGunzip ]; then
    gunzip -c "$1/$3_$4.tar.gz" | tar -xvf -
    else
    echo 'Unable to unpack due to lack of gtar/gzip support, exiting
    now'
    exit
    fi
    #tar -zxvf $3_$4.tar.gz; # UNPACK
    cp -pr $1$2/* $1; # REMOVE TARRED-STRUCTURED SUBFOLDER STRUCTURE AND
    REPLACE INTO EXISTING PATH
    pathRootName=`echo $2 | cut -d'/' -f2`; # YOU HAVE TO FIND "var" OR
    "home" OR WHATEVER IS THE ROOT PATH NAME OF $origPath
    rm -R $1/$pathRootName; # REMOVE TARRED-STRUCTURED SUBFOLDER
    RECURSIVELY
    }
    [/BASH]

    Thanx for your help, though!
    Phil


  2. Re: How to untar .tar.gz when you don't have "-z" option?


    Bill Marcum wrote:
    > On 26 Oct 2005 12:15:04 -0700, phillip.s.powell@gmail.com
    > wrote:
    > >
    > > DO I know why when I do this:
    > >
    > > ls -l /home/me/web/tools/app_10242005.tar.gz
    > > /home/me/web/tools/app_10242005.tar.gz
    > > gunzip -c /home/me/web/tools/app_10242005.tar.gz

    >
    > Do you have some sort of alias for "ls"? "ls -l" output should look
    > like this:
    >
    > -rwxr----- 1 somebody somegroup 1234 April 1 2005 app_10242005.tar.gz
    >
    >


    No, I was simply paraphrasing the output, the output was formatted
    normally.

    Phil

    > --
    > A fair exterior is a silent recommendation.
    > -- Publilius Syrus



  3. Re: How to untar .tar.gz when you don't have "-z" option?

    On 27 Oct 2005 08:29:25 -0700, phillip.s.powell@gmail.com wrote:
    >
    > Dave Hinz wrote:
    >
    >> ...and yet it uncompressed. Did you ever answer the question someone
    >> else asked about if you're in a chroot jail?

    >
    > No, because I'm not a system admin, not an enginner, not a UNIX guru.
    > I'm a Web guy, PHP/TCL/ASP/JSP web application guy.


    It could be related to why that path changes, which is why a couple
    people asked.

    > Thanx for your help, though!


    Did you ever go read ESR's article? It really will help you.


  4. Re: How to untar .tar.gz when you don't have "-z" option?

    Begin <3sei0oFm6r3eU2@individual.net>
    On 2005-10-28, Dave Hinz wrote:
    > On 27 Oct 2005 08:29:25 -0700, phillip.s.powell@gmail.com
    > wrote:
    >> Thanx for your help, though!

    >
    > Did you ever go read ESR's article? It really will help you.


    I note that a (repeatedly mentioned) application of `gtar' only was
    executed after a phone call. I tentatively conclude that reading any
    specific article will not effect the desired outcome, since OP has
    apparently basic problems with *reading*.


    --
    j p d (at) d s b (dot) t u d e l f t (dot) n l .

  5. Re: How to untar .tar.gz when you don't have "-z" option?

    Thanx for your help!
    Phil


  6. Re: How to untar .tar.gz when you don't have "-z" option?

    On 28 Oct 2005 14:35:26 GMT, jpd wrote:
    > Begin <3sei0oFm6r3eU2@individual.net>
    > On 2005-10-28, Dave Hinz wrote:


    >> Did you ever go read ESR's article? It really will help you.


    > I note that a (repeatedly mentioned) application of `gtar' only was
    > executed after a phone call. I tentatively conclude that reading any
    > specific article will not effect the desired outcome, since OP has
    > apparently basic problems with *reading*.


    Yes, it's unfortunate that those who would benefit the most from reading
    "how to ask questions the smart way" are, by nature, those who are least
    likely to actually read it.

    Not surprising, just unfortunate.


  7. Re: How to untar .tar.gz when you don't have "-z" option?

    In article <1130343646.404574.79430@g47g2000cwa.googlegroups.c om>,
    wrote:
    >See below.. thanx
    >
    >Dave Hinz wrote:
    >> On 26 Oct 2005 08:31:51 -0700, phillip.s.powell@gmail.com

    > wrote:
    >> > I am not used to this interface, sorry! AUGH!

    >>
    >> If you subscribe to news.individual.net for 10 euro a year (13 bucks or
    >> so), you can use a real newsreader and not have to suffer with google.
    >>
    >> > hasGunzip=`which gunzip | grep -E 'no gunzip'`

    >>
    >> All that proves is that it's not in your path. Ask your draconian
    >> hosting company where gzip and whatever you need, is located. If they
    >> don't know, or won't tell you, or it's not there and they won't fix
    >> that, get a better hosting company.

    >
    >Thanx, but that is not quite my problem. The problem is that I get an
    >error message when I'm trying to pipe a gunzip command on the file into
    >a tar command.
    >
    >[BASH]
    >gunzip -c $1/$3_$4.tar.gz | tar -xvf
    >[/BASH]
    >
    >produces
    >
    >
    >tar: usage tar [-]{txruc}[eONvVwAfblhm{op}][0-7[lmh]] [tapefile]
    >[blocksize] [[-C directory] file] ...
    >


    That I can see, nobody has gone to the trouble of pointing out that you
    have not specified the file source for the "tar -xvf" command. While GNU
    tar defaults to stdin if the source is not specified, few others do.

    Try "tar -xvf -"

    carl

    --
    carl lowenstein marine physical lab u.c. san diego
    clowenst@ucsd.edu

+ Reply to Thread
Page 3 of 3 FirstFirst 1 2 3