The problem was explained by "der bender" above, good explanation.
But for a solution, as a general rule, please get into the habit of always enclosing your URLs in single quotation marks '
. It's easy, simple and effective. When you copy-paste the URL, you want to make sure that the whole string will be passed as-is to wget
(or curl
, or any other program you're running). Only single quotation marks will do that.
Enclosing in double quotation marks as suggested is not ideal because the shell will still interpret it, substituting possible variables, processing other shell-specific special characters. Escaping the &
with backslash is not ideal for 2 reasons:
- you might forget to escape somewhere that you didn't notice
- you might not escape some special chars because you didn't know they were special
Even enclosing with single-quotation marks, you should still check your URL to make sure it doesn't have any single-quotation marks in it, but it's the only thing you'll be looking for. ;)
cat wget-log.2