i'm running a shell script that uses wget and pulls something over the web, my question is is there a way to tell wget to abort as soon as it hits 500 error code?
Asked
Active
Viewed 989 times
2 Answers
2
You might want to check our curl
as it's a bit more robust especially when handling things of that nature.
Now I don't know off the top of my head how to do what you want however curl
has certain exit codes for certain events. This one may be of interest to you:
22
HTTP page not retrieved. The requested url was not found or returned another error with the >HTTP error code being 400 or above. This return code only appears if -f/--fail is used.
I would recommend checking out the curl man page

WinkyWolly
- 598
- 6
- 19
-
I can't use curl, I need to use wget. – alexus May 25 '11 at 16:01
0
I guess wget doesn't have a way to handle any errors at this point :( that's kind of sucks, unfortinetly curl won't work for me, but if something I think curl's way of handeling it would be the closest so to speak solution...

alexus
- 13,112
- 32
- 117
- 174