2

I'm trying to download using wget a tar.gz. The file is redirected based on the url parameters, so all downloads are redirected automatically.

for example:

wget http://git.cross-lfs.org/?p=bootscripts-embedded.git;a=snapshot;h=HEAD;sf=tgz

// returns:
index.html?p=bootscripts-embedded.git

If I try to rename this to something.tar.gz and untar it, it's an invalid file.

I've tried various options such as

--content-disposition
--max-redirect=10
--recursive
--level=10

with no luck.

how can I download this file without needing something like curl?

I'm using wget version 1.12

1 Answer 1

4

You just need some quotes to prevent the shell from misinterpreting the semicolons...

[mpenning@tsunami ~]$ wget "http://git.cross-lfs.org/?p=bootscripts-embedded.git;a=snapshot;h=HEAD;sf=tgz"

Resolving git.cross-lfs.org... 208.97.140.69
Connecting to git.cross-lfs.org|208.97.140.69|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/x-gzip]
Saving to: âindex.html?p=bootscripts-embedded.git;a=snapshot;h=HEAD;sf=tgzâ

    [ <=>                                   ] 2,841       --.-K/s   in 0.001s

2014-01-07 02:24:11 (2.25 MB/s) - âindex.html?p=bootscripts-embedded.git;a=snapshot;h=HEAD;sf=tgzâ

[mpenning@tsunami ~]$ file index.html\?p\=bootscripts-embedded.git\;a\=snapshot\;h\=HEAD\;sf\=tgz
index.html?p=bootscripts-embedded.git;a=snapshot;h=HEAD;sf=tgz: 
     gzip compressed data, from Unix, last modified: Tue Jan  7 02:24:11 2014
[mpenning@tsunami ~]$
1
  • wow, so simple. face-palm
    – SnakeDoc
    Commented Jan 7, 2014 at 8:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .