Hello!
I found out, that the -r option of wget prevents any other return code
than 0. This is bad in case of invalid host name or path.

Here an example with an invalid host:
--snip--
markus@phoenix:~> wget http://host.doesnotexist.there ; echo Result: $?
--19:22:43--  http://host.doesnotexist.there/
           => `index.html'
Resolving host.doesnotexist.there... failed: Host not found.
Result: 1
markus@phoenix:~> wget -r http://host.doesnotexist.there ; echo Result: $?
--19:22:48--  http://host.doesnotexist.there/
           => `host.doesnotexist.there/index.html'
Resolving host.doesnotexist.there... failed: Host not found.

FINISHED --19:22:48--
Downloaded: 0 bytes in 0 files
Result: 0
--snip--

And here with an invalid path:
--snip--
markus@phoenix:~> wget -r http://www.gaugusch.at/doesntexist ;
echo Result: $?
--19:24:34--  http://www.gaugusch.at/doesntexist
           => `www.gaugusch.at/doesntexist'
Resolving www.gaugusch.at... done.
Connecting to www.gaugusch.at[195.202.144.152]:80... connected.
HTTP request sent, awaiting response... 404 Not Found
19:24:35 ERROR 404: Not Found.


FINISHED --19:24:35--
Downloaded: 0 bytes in 0 files
Result: 0
markus@phoenix:~> wget http://www.gaugusch.at/doesntexist ; echo
Result: $?
--19:24:37--  http://www.gaugusch.at/doesntexist
           => `doesntexist'
Resolving www.gaugusch.at... done.
Connecting to www.gaugusch.at[195.202.144.152]:80... connected.
HTTP request sent, awaiting response... 404 Not Found
19:24:37 ERROR 404: Not Found.

Result: 1
--snip--

regards,
Markus Gaugusch

-- 
_____________________________     /"\
Markus Gaugusch  ICQ 11374583     \ /    ASCII Ribbon Campaign
[EMAIL PROTECTED]                 X     Against HTML Mail
                                  / \

Reply via email to