curl to stdout and untar a zip to a specific directory [duplicate]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
-3
down vote

favorite













This question already has an answer here:



  • How to redirect output of wget as input to unzip?

    5 answers



  • How to curl and unzip to a certain directory? [duplicate]

    1 answer



What is the correct way to curl to stdout, then untar (a zip file in that case) to a specific directory?



This failed:



curl URL | tar -x > /path


So I thought of this which also failed:



curl URL | tar -x > /path






share|improve this question














marked as duplicate by Jeff Schaller, Stephen Kitt, ilkkachu, muru, G-Man Jan 31 at 0:33


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • Why would you untar a zip file rather than unzipping it? Or is it a gzip file containing a tar archive? gzip and zip are two different things.
    – DopeGhoti
    Jan 30 at 19:53










  • curl URL | unzip > /path fails.
    – user273275
    Jan 30 at 19:57










  • unzip cannot unzip from standard input, as stated in its manual page. You will have to write to a temporary file, unzip it, and delete the file.
    – DopeGhoti
    Jan 30 at 19:58










  • That's why I contemplated tar... It's not possible at all with tar? I really don't know.
    – user273275
    Jan 30 at 20:04










  • tar doesn't speak PKZip.
    – DopeGhoti
    Jan 30 at 20:06














up vote
-3
down vote

favorite













This question already has an answer here:



  • How to redirect output of wget as input to unzip?

    5 answers



  • How to curl and unzip to a certain directory? [duplicate]

    1 answer



What is the correct way to curl to stdout, then untar (a zip file in that case) to a specific directory?



This failed:



curl URL | tar -x > /path


So I thought of this which also failed:



curl URL | tar -x > /path






share|improve this question














marked as duplicate by Jeff Schaller, Stephen Kitt, ilkkachu, muru, G-Man Jan 31 at 0:33


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • Why would you untar a zip file rather than unzipping it? Or is it a gzip file containing a tar archive? gzip and zip are two different things.
    – DopeGhoti
    Jan 30 at 19:53










  • curl URL | unzip > /path fails.
    – user273275
    Jan 30 at 19:57










  • unzip cannot unzip from standard input, as stated in its manual page. You will have to write to a temporary file, unzip it, and delete the file.
    – DopeGhoti
    Jan 30 at 19:58










  • That's why I contemplated tar... It's not possible at all with tar? I really don't know.
    – user273275
    Jan 30 at 20:04










  • tar doesn't speak PKZip.
    – DopeGhoti
    Jan 30 at 20:06












up vote
-3
down vote

favorite









up vote
-3
down vote

favorite












This question already has an answer here:



  • How to redirect output of wget as input to unzip?

    5 answers



  • How to curl and unzip to a certain directory? [duplicate]

    1 answer



What is the correct way to curl to stdout, then untar (a zip file in that case) to a specific directory?



This failed:



curl URL | tar -x > /path


So I thought of this which also failed:



curl URL | tar -x > /path






share|improve this question















This question already has an answer here:



  • How to redirect output of wget as input to unzip?

    5 answers



  • How to curl and unzip to a certain directory? [duplicate]

    1 answer



What is the correct way to curl to stdout, then untar (a zip file in that case) to a specific directory?



This failed:



curl URL | tar -x > /path


So I thought of this which also failed:



curl URL | tar -x > /path




This question already has an answer here:



  • How to redirect output of wget as input to unzip?

    5 answers



  • How to curl and unzip to a certain directory? [duplicate]

    1 answer









share|improve this question













share|improve this question




share|improve this question








edited Jan 30 at 19:58

























asked Jan 30 at 19:42









user273275

13




13




marked as duplicate by Jeff Schaller, Stephen Kitt, ilkkachu, muru, G-Man Jan 31 at 0:33


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by Jeff Schaller, Stephen Kitt, ilkkachu, muru, G-Man Jan 31 at 0:33


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.













  • Why would you untar a zip file rather than unzipping it? Or is it a gzip file containing a tar archive? gzip and zip are two different things.
    – DopeGhoti
    Jan 30 at 19:53










  • curl URL | unzip > /path fails.
    – user273275
    Jan 30 at 19:57










  • unzip cannot unzip from standard input, as stated in its manual page. You will have to write to a temporary file, unzip it, and delete the file.
    – DopeGhoti
    Jan 30 at 19:58










  • That's why I contemplated tar... It's not possible at all with tar? I really don't know.
    – user273275
    Jan 30 at 20:04










  • tar doesn't speak PKZip.
    – DopeGhoti
    Jan 30 at 20:06
















  • Why would you untar a zip file rather than unzipping it? Or is it a gzip file containing a tar archive? gzip and zip are two different things.
    – DopeGhoti
    Jan 30 at 19:53










  • curl URL | unzip > /path fails.
    – user273275
    Jan 30 at 19:57










  • unzip cannot unzip from standard input, as stated in its manual page. You will have to write to a temporary file, unzip it, and delete the file.
    – DopeGhoti
    Jan 30 at 19:58










  • That's why I contemplated tar... It's not possible at all with tar? I really don't know.
    – user273275
    Jan 30 at 20:04










  • tar doesn't speak PKZip.
    – DopeGhoti
    Jan 30 at 20:06















Why would you untar a zip file rather than unzipping it? Or is it a gzip file containing a tar archive? gzip and zip are two different things.
– DopeGhoti
Jan 30 at 19:53




Why would you untar a zip file rather than unzipping it? Or is it a gzip file containing a tar archive? gzip and zip are two different things.
– DopeGhoti
Jan 30 at 19:53












curl URL | unzip > /path fails.
– user273275
Jan 30 at 19:57




curl URL | unzip > /path fails.
– user273275
Jan 30 at 19:57












unzip cannot unzip from standard input, as stated in its manual page. You will have to write to a temporary file, unzip it, and delete the file.
– DopeGhoti
Jan 30 at 19:58




unzip cannot unzip from standard input, as stated in its manual page. You will have to write to a temporary file, unzip it, and delete the file.
– DopeGhoti
Jan 30 at 19:58












That's why I contemplated tar... It's not possible at all with tar? I really don't know.
– user273275
Jan 30 at 20:04




That's why I contemplated tar... It's not possible at all with tar? I really don't know.
– user273275
Jan 30 at 20:04












tar doesn't speak PKZip.
– DopeGhoti
Jan 30 at 20:06




tar doesn't speak PKZip.
– DopeGhoti
Jan 30 at 20:06










2 Answers
2






active

oldest

votes

















up vote
0
down vote



accepted










Duplicate of How to redirect output of wget as input to unzip? (wget and curl are interchangeable in this context). Please see this answer. Replicating it here:



wget URL -O path/temp.zip; unzip -d path path/temp.zip; rm path/temp.zip


Replace URL and path accordingly.






share|improve this answer



























    up vote
    -2
    down vote













    Maybe this will work:



    curl URL > /path && tar -xvf /path





    share|improve this answer


















    • 2




      The || is a logical 'or' operator. It will cause the tar command to only be executed if the curl command returns a failure exit code. I asw your answer only because I offered to help new contributors to this site by offering advice, so I guess the advice would be to try out your answer before posting it. You may have meant to use the logical 'and' operator &&.
      – user1404316
      Jan 30 at 21:51






    • 1




      @StephenKitt I'm curious...
      – roaima
      Jan 30 at 22:21


















    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote



    accepted










    Duplicate of How to redirect output of wget as input to unzip? (wget and curl are interchangeable in this context). Please see this answer. Replicating it here:



    wget URL -O path/temp.zip; unzip -d path path/temp.zip; rm path/temp.zip


    Replace URL and path accordingly.






    share|improve this answer
























      up vote
      0
      down vote



      accepted










      Duplicate of How to redirect output of wget as input to unzip? (wget and curl are interchangeable in this context). Please see this answer. Replicating it here:



      wget URL -O path/temp.zip; unzip -d path path/temp.zip; rm path/temp.zip


      Replace URL and path accordingly.






      share|improve this answer






















        up vote
        0
        down vote



        accepted







        up vote
        0
        down vote



        accepted






        Duplicate of How to redirect output of wget as input to unzip? (wget and curl are interchangeable in this context). Please see this answer. Replicating it here:



        wget URL -O path/temp.zip; unzip -d path path/temp.zip; rm path/temp.zip


        Replace URL and path accordingly.






        share|improve this answer












        Duplicate of How to redirect output of wget as input to unzip? (wget and curl are interchangeable in this context). Please see this answer. Replicating it here:



        wget URL -O path/temp.zip; unzip -d path path/temp.zip; rm path/temp.zip


        Replace URL and path accordingly.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 30 at 20:45









        thiagowfx

        726412




        726412






















            up vote
            -2
            down vote













            Maybe this will work:



            curl URL > /path && tar -xvf /path





            share|improve this answer


















            • 2




              The || is a logical 'or' operator. It will cause the tar command to only be executed if the curl command returns a failure exit code. I asw your answer only because I offered to help new contributors to this site by offering advice, so I guess the advice would be to try out your answer before posting it. You may have meant to use the logical 'and' operator &&.
              – user1404316
              Jan 30 at 21:51






            • 1




              @StephenKitt I'm curious...
              – roaima
              Jan 30 at 22:21















            up vote
            -2
            down vote













            Maybe this will work:



            curl URL > /path && tar -xvf /path





            share|improve this answer


















            • 2




              The || is a logical 'or' operator. It will cause the tar command to only be executed if the curl command returns a failure exit code. I asw your answer only because I offered to help new contributors to this site by offering advice, so I guess the advice would be to try out your answer before posting it. You may have meant to use the logical 'and' operator &&.
              – user1404316
              Jan 30 at 21:51






            • 1




              @StephenKitt I'm curious...
              – roaima
              Jan 30 at 22:21













            up vote
            -2
            down vote










            up vote
            -2
            down vote









            Maybe this will work:



            curl URL > /path && tar -xvf /path





            share|improve this answer














            Maybe this will work:



            curl URL > /path && tar -xvf /path






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Jan 30 at 22:17









            Stephen Kitt

            142k22308370




            142k22308370










            answered Jan 30 at 20:18









            Sanchd

            1




            1







            • 2




              The || is a logical 'or' operator. It will cause the tar command to only be executed if the curl command returns a failure exit code. I asw your answer only because I offered to help new contributors to this site by offering advice, so I guess the advice would be to try out your answer before posting it. You may have meant to use the logical 'and' operator &&.
              – user1404316
              Jan 30 at 21:51






            • 1




              @StephenKitt I'm curious...
              – roaima
              Jan 30 at 22:21













            • 2




              The || is a logical 'or' operator. It will cause the tar command to only be executed if the curl command returns a failure exit code. I asw your answer only because I offered to help new contributors to this site by offering advice, so I guess the advice would be to try out your answer before posting it. You may have meant to use the logical 'and' operator &&.
              – user1404316
              Jan 30 at 21:51






            • 1




              @StephenKitt I'm curious...
              – roaima
              Jan 30 at 22:21








            2




            2




            The || is a logical 'or' operator. It will cause the tar command to only be executed if the curl command returns a failure exit code. I asw your answer only because I offered to help new contributors to this site by offering advice, so I guess the advice would be to try out your answer before posting it. You may have meant to use the logical 'and' operator &&.
            – user1404316
            Jan 30 at 21:51




            The || is a logical 'or' operator. It will cause the tar command to only be executed if the curl command returns a failure exit code. I asw your answer only because I offered to help new contributors to this site by offering advice, so I guess the advice would be to try out your answer before posting it. You may have meant to use the logical 'and' operator &&.
            – user1404316
            Jan 30 at 21:51




            1




            1




            @StephenKitt I'm curious...
            – roaima
            Jan 30 at 22:21





            @StephenKitt I'm curious...
            – roaima
            Jan 30 at 22:21



            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Displaying single band from multi-band raster using QGIS

            How many registers does an x86_64 CPU actually have?