tags:

views:

670

answers:

2

What does it do? I read that it downloads things from Stdin, but where do you actually need it?

Conclusion

some_program | wget -i - -P ./directory

wget gets urls as Stdin from some_program. The input will result in output generated by wget to ./directory.

wget -i ./file

The above command gets urls form ./file, and it generates output to the current directory. The crux difference is the lack of - sign to the above command.

+5  A: 

I can imagine it being useful when piping output from another program:

linkdiscoverer | wget -i - ./directory

(For some suitable linkdiscoverer program.)

I'm not sure the ./directory bit is really what you want though. Did you mean to use -P ./directory to save files into the specified directory?

Jon Skeet
@ST: -i means "download URLs from a file, while -P means apparently "save files to the directory" --- This means that John is right because of your statement"downloading things from Stdin".
Masi
@Jon Skeet: Yes! Thank you.
Masi
A: 

I read that it downloads things from Stdin, but where do you actually need it?

Maybe re-read man pages again:

‘-i file’
‘--input-file=file’
    Read urls from file. If ‘-’ is specified as file, urls are read from the standard input. (Use ‘./-’ to read from a file literally named ‘-’.)
PeterMmm