So after some time of searching on Google and Super User (and scanning man pages) I was unable to find an answer to something that (I think) should be simple:
If you go here:
http://www.vim.org/scripts/script.php?script_id=2340
And try to download the theme:
http://www.vim.org/scripts/download_script.php?src_id=9750
Like so:
wget http://www.vim.org/scripts/download_script.php?src_id=9750
You’ll probably end up with a file called download_script.php?src_id=9750
.
But I want it to be called molokai.vim
, which is what would happen if I used a browser to download this file.
What options do I need to specify for wget for the desired effect?
I'd also be ok with a Curl equivalent command.
Best Answer
So,
Or, you may be able to get
wget
to automatically use the filename proposed by the server using the--content-disposition
option if supported by your version.Caveats as per the man page,
You can achieve the same automated behavior with
curl
, using,-O
uses the remote name, and-J
forces the-O
to get that name from the content-disposition header rather than the URL, and-L
follows redirects if needed.