Re: verify URL

Tronche Ch. le pitre (Christophe.Tronche@lri.fr)
Wed, 13 Mar 96 20:57:37 +0100


> Is there a simple/short/free app that can check for the presence of a
> URL and return a yes/no if it can get it?

What about this one:

======================================================================
#!/bin/sh

code=`/bin/echo "HEAD $2 HTTP/1.0\n" | telnet $1 80 | awk '/^HTTP\/*\.*/ { print $2; exit }'`
if [ "$code" = 200 ]; then
echo yes
else
echo no
fi
======================================================================

+--------------------------+------------------------------------+
| | |
| Christophe TRONCHE | E-mail : tronche@lri.fr |
| | |
| +-=-+-=-+ | Phone : 33 - 1 - 69 41 66 25 |
| | Fax : 33 - 1 - 69 41 65 86 |
+--------------------------+------------------------------------+
| ###### ** |
| ## # Laboratoire de Recherche en Informatique |
| ## # ## Batiment 490 |
| ## # ## Universite de Paris-Sud |
| ## #### ## 91405 ORSAY CEDEX |
| ###### ## ## FRANCE |
|###### ### |
+---------------------------------------------------------------+