Thu 27 Nov 2008 03:03:53 AM UTC, comment #3:
hi, I think there might be a confussion about the meaning of -
to write to a file named - one should write to ./- instead, that's not a problem from wget it's the normal way - is interpreted (as an alias of stdout).
so:
$ LC_ALL=C wget -O ./- ix.de
--2008-11-27 00:49:03-- http://ix.de/
Resolving ix.de... 193.99.144.80
Connecting to ix.de|193.99.144.80|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://www.heise.de/ix/ [following]
--2008-11-27 00:49:04-- http://www.heise.de/ix/
Resolving http://www.heise.de... 193.99.144.85
Connecting to http://www.heise.de|193.99.144.85|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `./-'
[ <=> ] 29,184 21.7K/s in 1.3s
2008-11-27 00:49:06 (21.7 KB/s) - `./-' saved [29184]
$ ls -la
total 41
-rw-r--r-- 1 samus users 29184 2008-11-27 00:49 -
drwxr-xr-x 2 samus users 72 2008-11-27 00:49 .
drwx--x--x 117 samus users 9640 2008-11-27 00:47 ..
when you write to - you're using it as an alias of stdout, which will print the page to the console directly. I don't think this is useless since the rest the output is correctly sent to stderr so there's no mixing, you can handle them separately.
a real world example might be: http://www.linuxquestions.org/questions/linux-software-2/desktop-wallpaper-changer-646084/#post3243438 and the use of -q is independent of the use of -O- imho.
as for the messages sent, here's the output I see (v1.11.4):
$ LC_ALL=C wget -O - ix.de >/dev/null
--2008-11-27 00:55:45-- http://ix.de/
Resolving ix.de... 193.99.144.80
Connecting to ix.de|193.99.144.80|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://www.heise.de/ix/ [following]
--2008-11-27 00:55:46-- http://www.heise.de/ix/
Resolving http://www.heise.de... 193.99.144.85
Connecting to http://www.heise.de|193.99.144.85|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `STDOUT'
[ <=> ] 29,150 21.4K/s in 1.3s
2008-11-27 00:55:48 (21.4 KB/s) - `-' saved [29150]
(yet another example that uses -O- and not requires -q) it first says "Saving to: `STDOUT'" and then "`-' saved" which is probably not the clearest message but it's understandable I think.
|