How to download images with wget

1

I'm doing this wget script called wget-images, which should download images from a website. It looks like this now:

wget -e robots=off -r -l1 --no-parent -A.jpg

The thing is, in the terminal when i put ./wget-images www.randomwebsite.com, it says

wget: missing URL

I know it works if I put url in the text file and then run it, but how can I make it work without adding any urls into the text file? I want to put link in the command line and make it understand that I want pictures of that certain link that I just wrote as a parameter.

Kenny Heinonen

Posted 2010-10-06T10:06:33.573

Reputation: 11

Just add a command line argument to your script and use that as the URL. – Chris – 2010-10-06T12:53:45.373

Answers

1

You forgot to add the positional parameters to the wget call, i.e. "$@".

Ignacio Vazquez-Abrams

Posted 2010-10-06T10:06:33.573

Reputation: 100 516