bug-wget
[Top][All Lists]
Advanced

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

Re: [Bug-wget] Why limit --max-redirect can results in exit_status 8?


From: Tim Rühsen
Subject: Re: [Bug-wget] Why limit --max-redirect can results in exit_status 8?
Date: Sun, 11 Aug 2019 14:29:00 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

On 09.08.19 22:37, Peng Yu wrote:
> Hi,
> 
> The exit status 8 means "Server issued an error response." But I think
> the exit status may not be considered as an error in the specific use
> case. Is there a way to make wget return 0 instead?
> 
> $ wget -q --spider -S -o /dev/null --max-redirect 1
> https://httpbin.org/absolute-redirect/3 || echo $?
> 8
> $ wget -q --spider -S -o /dev/null
> https://httpbin.org/absolute-redirect/3 || echo $?
> 8

'8' could be one of several (pretty many) different errors. The value
aggregates / simplifies error handling.

If you are going to batch test servers/URLs for their headers, you might
take a look at wget2. It has a statistics output for each URL/server
including number of links (with max-redirect it would be 0 or 1).

Looks for '--stats-site' at
https://gnuwget.gitlab.io/wget2/reference/md_wget2.html.

If you are able to read/write C code, fork/download the project from
Gitlab and check the examples/.

Regards, Tim

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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