Results 1 to 7 of 7
Hi,
i want to write a shell script about wget for download picture.
i want to enter web site adress and type of file
and script will download files which ...
- 01-15-2010 #1Just Joined!
- Join Date
- Dec 2009
- Posts
- 28
wget
Hi,
i want to write a shell script about wget for download picture.
i want to enter web site adress and type of file
and script will download files which are defined on entered web site.
how can i do it?
thanksLast edited by Utnubu; 01-15-2010 at 10:06 AM. Reason: wrong question
- 01-15-2010 #2Not entirely sure whether it works or not ( writing out of my head ) - let us know the outcomeCode:
wget -r google.com --accept=jpg,jpeg
- 01-16-2010 #3Just Joined!
- Join Date
- Dec 2009
- Posts
- 28
thanks but how can i do it with script.
bash shell script.
i want to enter web site and type of picture with argument.
for example
./trial.sh Open Source and Linux Forums jpg
help me
- 01-16-2010 #4
Utnubu, you need to read up on shell scripting. All of your questions so far have been really simple questions that you could find the answer to with Google much faster than you could from a forum
It's better to have a go yourself first and ask when you run into problems you cannot solveLinux User #453176
- 01-16-2010 #5Just Joined!
- Join Date
- Dec 2009
- Posts
- 28
i am trying it. i didnt ask directly to forum. i've been researching.
if i know how to pass arguments to command line, i will do it.
thanksLast edited by Utnubu; 01-16-2010 at 10:20 AM. Reason: edit
- 01-16-2010 #6Just Joined!
- Join Date
- Dec 2009
- Posts
- 28
i think its not like this, can you have a look?
first parameter web site
second one is type
third one is directory
#!/bin/bash
wget *-r *-l1 *-accept='$2' *-P ~/'$3' '$1'
- 01-16-2010 #7
Yes, $1 would be the first argument, $2 the second and so on
I'm not sure why you have and * in there though. Try:
Code:#!/bin/bash wget -r -l1 -accept='$2' -P ~/'$3' '$1'
Linux User #453176


Reply With Quote