[Torte] aiuto per bash script ed errori 404

mjs2020 mjs2020 a fastwebnet.it
Lun 23 Apr 2007 12:09:58 CEST


Ciao a tutti,
sto cercando di fare un file bash che controlli se un indirizzo http 
restituisce qualcosa o se da un errore 404.
In parole umane:
"SE l'indirizzo http://www.google.com/pippo.html dà un errore 404 ALLORA 
scrivi in log e fai ripartire un programma"
(esempio stupido ma è per capire)

sto provando con wget e grep ma:
12:15:34 $ wget http://www.google.com/pippo.html | grep 404
--12:16:21--  http://www.google.com/pippo.html
           => `pippo.html'
Resolving www.google.com... 72.14.221.104, 72.14.221.147, 72.14.221.99, ...
Connecting to www.google.com|72.14.221.104|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
12:16:21 ERROR 404: Not Found.

cioè è come se non mettessi "| grep 404" come faccio a dare una 
condizione che verifichi questa cosa in un file bash?
grazie a hi vorrà mettermi sulla strada giusta
mjs2020


Maggiori informazioni sulla lista Torte