Jeudi 26 novembre 2009
4
26
/11
/Nov
/2009
13:20
Ne nous arretons pas en si bon chemin et continuons à creer nos deux tableaux CONTEXTE:
Bon, voici le script:
#!/bin/bash
echo "Pour analyser des fichiers dans un répertoire, saisir un chemin S.V.P: ";
read dossier;
echo "Répertoire lu et donne le chemin où tu veux créer la page :";
read tablo;
echo "Tableau créé";
echo "<html><head><title>Tableau des liens</title></head>" > $tablo;
echo "<body style=\"background-color: #CC3366;\"><center><p align=\"justify\"><font style=\"font-family:arial;\" color=\"orange\" ><h1>Voici le tableau des
liens</h1></font></p><table border=\"1\" bgcolor=\"silver\" width=\"30%\">" > $tablo;
i=1
for fichier in `ls $dossier`
{
y=1;
echo "<thead><tr><th>Fichier $fichier</th><th>PAGES-ASPIREES</th><th>DUMP
TEXT</th><th>CONTEXTE.txt</th><tr></thead>">> $tablo;
for nom in `cat $dossier/$fichier`
{
wget -O ./PAGES-ASPIREES/$i.html $nom
lynx -dump $nom > ./DUMP-TEXT/$i.txt
egrep -i "\b$motif\b" ./DUMP-TEXT/$i.txt > ./CONTEXTES/$i.txt
echo "<tr><td><a href=\"$nom\">$nom</a></td><td><a href=\"../PAGES-ASPIREES/$i.html\">PAGE
ASPIREE</a></td><td><a href=\"../DUMP-TEXT/$i.txt\">PAGE DUMP</a></td><td><a href=\"../CONTEXTES/$i.txt\">PAGE
CONTEXTE</a></td></tr>" >> $tablo;
let "i+=1" ;
let "y+=1" ;
}
}
echo "</table></body></html>" >> $tablo;
MAIS IL RESTE ENCORE DU BOULOT.
Je vous ai presenté le corps presque final du projet.
Il reste quelques modifications à effectuer....
On s'en rapproche, suivez le guide...