I think you pretty much answer how to do this.
If wget fails, I would like to exit and not run some_processing or create an empty file.
wget wget -qO- example.com/duff
if [[$? -ne 0]] // $? means return value, on well-written programs it should be zero
then
some_processing >> outfile.txt
c
I think this will accomplish what you want.
source share