Is is possible to prevent Wget from making an output file when there is an error like 404.
When I run
wget -O my.html http://sdfsdfdsf.sdfds
http://sdfsdfdsf.sdfds does not exist but Wget still creates my.html
I am making a bash script and want to make sure it stops if wget can’t get a valid file.
wget returns a non-zero response for non-200 replies (it seems).
This sample code worked for me with GNU wget:
Here’s more info about
$?from here.