Estrazione nome sito da URL
   
    blug@lists.linux.it
     
    blug@lists.linux.it
       
    Tue, 17 Dec 2002 16:47:06 +0100
    
    
  
Pare che Mauro Barattin, in un momento di ispirazione, abbia scritto:
 > Dovrei estrarre da un URL il solo nome del sito. Ad esempio dalle seguenti
 > due linee vorrei estrarre solo il "www.html.it" (tutto quello che c'è tra
 > http:// e la fine della stringa oppure il primo "/" dell'URL).
 > 
 > http://www.html.it
 > http://www.html.it/banner/wooow/468x60.gif 
 > 
 > Avete qualcosa di già pronto?
url="http://www.html.it/banner/wooow/468x60.gif"
hostname="${url#http://}"; hostname="${hostname%%/*}"; 
echo $hostname
-- 
 |   \    \  | ___|_  |_  | ianezz AT sodalia.it
 |  _ \  | \ | _|    /   /  Visita il LinuxTrent a
_|_/  _\_|  _|____|___|___| http://www.linuxtrent.it