(09/27/2011 08:53 AM), Tim Pizey wrote:
> Hi,
> 
> at the moment  (v 1.12) wget returns status 8   (Server issued an
> error response) for any
> non 200 status.
> 
> It would be really nice it the actual error status was returned.
> That is an http status of 200 returned a bash status of 0, all other
> statuses were returned unaltered.
> 
> (For what it is worth curl appears to return unix status 0 for 404
> pages, I can at least check for status 8 with wget)

I'm afraid that you ask is impossible, given that only the bottom 8 bits
(0 - 255) of the status from a normal exit are available (in Unix
environments, anyway). For instance, try running the following in your
shell:

$  for i in 254 255 256 257; do ( exit $i ); echo exited with $?; done
exited with 254
exited with 255
exited with 0
exited with 1
$

HTTP error statuses are all in the 400s and 500s.

-- 
Micah J. Cowan
http://micah.cowan.name/

Reply via email to