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
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
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.
curl URL | unzip > /path
fails. – Arcticooling Jan 30 '18 at 19:57unzip
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 '18 at 19:58tar
... It's not possible at all withtar
? I really don't know. – Arcticooling Jan 30 '18 at 20:04tar
doesn't speak PKZip. – DopeGhoti Jan 30 '18 at 20:06jar
trick. As long as you don’t need to preserve permissions, it should work for you: it can extract from standard input. – Stephen Kitt Jan 30 '18 at 22:13