Blog » Wget and URLs with Ampersands

Wget and URLs with Ampersands

I have been working around some issues with Wget recently and after modifying the URLs, I found that it would start failing if the URL was a querystring with more than one variable. This means that you would have an & in the string.

Well, Wget sees this as an additional command so you need to delimit it somehow. Googling turned up this article that indicates either enclosing the URL in single-quotes (‘) or delimiting the ampersand character with a backslash. The comments on this post all praise this solution.

Only problem… Neither worked for me. Then I thought, perhaps this is another “oddity” of running it on the Windows port. So, I tried enclosing the URL in double quotes and voila it worked! So, let that be a lesson to you: Don’t assume every ported program from Linux runs as you’d expect when under Windows.

Michael Gibbs
Stalk Me...
Latest posts by Michael Gibbs (see all)