Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Instead of -O you want to use

  --remote-name-all
otherwise you have to specify -O for every URL specified. For the same reason, remove $1 and rely on all parameters being added at the end of line. The example above will only download the first URL.

(I personally think this should have been the default from the beginning, -O should have set the behaviour for all following parameters until changed, but that is too late to change now.)

There is also --remote-header-name (-J) which takes the remote file name from the header instead of the URL, which is what wget does.



> There is also --remote-header-name (-J) which takes the remote file name from the header instead of the URL, which is what wget does.

I don't think that's the case, that behavior is opt-in as indicated in wget's manpage:

> This can currently result in extra round-trips to the server for a "HEAD" request, and is known to suffer from a few bugs, which is why it is not currently enabled by default.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: