bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-wget] Returning the http status


From: Micah Cowan
Subject: Re: [Bug-wget] Returning the http status
Date: Tue, 27 Sep 2011 14:26:50 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.21) Gecko/20110831 Thunderbird/3.1.13

(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

[Prev in Thread] Current Thread [Next in Thread]