-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Alan Wehmann wrote: > Fred Holmes <fsh <at> cpcug.org> writes: > >> If I have a URL that has %20 in place of spaces, and I use the URL directly >> as > the argument of WGET, it seems that >> the file is always "not found". I've discovered that if I replace each %20 > with a space, and put quotation >> marks around the entire URL, it works. >> . . . > > > This topic is of interest to me, since I am using wget in a Windows XP command > shell, to fetch files from a HTTP server. A number of the file names have > spaces in them and in the url these were replace by "%20"; these files did not > successfully download. What I realized is that the "%" character is not > protected by using double quotes surrounding the url. I could see this by > having "echo on" as the first line of my command file. The "escape" character > "^" that protects other special characters in the command shell doesn't help > in > the case of "%". What does seem to work is to replace "%20" by "%%20". > > I am not a subscriber to > > wget@sunsite.dk > > so please include my email address in replies.
I'm not sure what sort of replies you are looking for, as you haven't asked a question. :) It is, of course, the responsibility of the user to ensure that he properly escapes characters that he wants to pass literally to Wget. Note that it's not necessary to convert space characters to %20; simply putting quotes around the whole URL to protect the spaces from becoming field separators for the shell is quite enough. Also, when you quote from a three-year-old comment, it's usually advisable to mention a little more about the context of the message, and where we can find the original thread. But, yeah, if your shell treats % specially, then obviously you need to escape them. This has nothing in particular to do with Wget, but rather with using whatever particular command shell you have. - -- Micah J. Cowan Programmer, musician, typesetting enthusiast, gamer... http://micah.cowan.name/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHIjv57M8hyUobTrERCLyEAJ9Gs5lS9qphZNrlYAz44PaldobFegCfcxC7 x7jIj/DgL+xZt2gXFfcf1No= =CmqR -----END PGP SIGNATURE-----