Le script bash pour l'anglais

V1AN.sh

#!/bin/sh

#

read tablo;

echo "Creation page html pour l'anglais";

#

# Tableau 1

# Titre dans le title-bar et titre de la page

read fic1;

echo "<html><head><title>Bouchon en anglais</title></head><body bgcolor=\"lightblue\"><h2><font color=\"red\"><CENTER>Bouchon en anglais</CENTER></font></h2><CENTER><table width=\"75%\" border=\"1\">" > $tablo;

# Creation table dans table

echo "<tr><td><CENTER><img src=\"../IMAGES/bouchonconteneur.jpg\"></CENTER></td><td rowspan=\"2\"><table width=\"100%\" border=\"1\"><tr><td bgcolor=\"white\" colspan=\"4\"><CENTER>CONTENEUR : a stopper</CENTER></td></tr>" >> $tablo;

# Initialisation du compteur

i=1

# Outils : Wget, lynx, egrep et cat.

for nom1 in `cat $fic1`

{

wget -rO ./PAGES-ASPIREES/Anglais/$i.html $nom1

lynx -dump -nolist $nom1 > ./DUMP-TEXT/Anglais/$i.html

egrep -i "\bstopper\b" ./DUMP-TEXT/Anglais/$i.html > ./CONTEXTES/Anglais/$i.html

cat ./CONTEXTES/Anglais/$i.html >> ./CONTEXTES/conteneur-an.txt

echo "<tr><td width=\"150\" align=\"center\"><a href=\"$nom1\">URL $i</a></td>

<td width=\"150\" align=\"center\"><a href=\"../PAGES-ASPIREES/Anglais/$i.html\">PAGE ASPIREE</a></td>

<td width=\"150\" align=\"center\"><a href=\"../DUMP-TEXT/Anglais/$i.html\">PAGE DUMP</a></td>

<td width=\"150\" align=\"center\"><a href=\"../CONTEXTES/Anglais/$i.html\">PAGE CONTEXTE</a></td></tr>" >> $tablo;

let "i=i+1" ;

}

echo "</td></tr></table><tr><td bgcolor=\"white\"><iframe src=\"../NUAGES/contexte-conteneur-an-dic.TXT.html\" width=\"100%\" height=\"100%\"></iframe></td></tr></table></CENTER>" >> $tablo;

#

# Tableau 2

read fic2;

echo "<p><CENTER><table width=\"75%\" border=\"1\">" >> $tablo;

echo "<tr><td><CENTER><img src=\"../IMAGES/bouchonliege.jpg\"></CENTER></td><td rowspan=\"2\"><table width=\"100%\" border=\"1\"><tr><td bgcolor=\"white\" colspan=\"4\"><CENTER>LIEGE : cork</CENTER></td></tr>" >> $tablo;

# Outils : Wget, lynx, egrep et cat.

for nom2 in `cat $fic2`

{

wget -rO ./PAGES-ASPIREES/Anglais/$i.html $nom2

lynx -dump -nolist $nom2 > ./DUMP-TEXT/Anglais/$i.html

egrep -i "\bcork\b" ./DUMP-TEXT/Anglais/$i.html > ./CONTEXTES/Anglais/$i.html

cat ./CONTEXTES/Anglais/$i.html >> ./CONTEXTES/liege-an.txt

echo "<tr><td width=\"150\" align=\"center\"><a href=\"$nom2\">URL $i</a></td>

<td width=\"150\" align=\"center\"><a href=\"../PAGES-ASPIREES/Anglais/$i.html\">PAGE ASPIREE</a></td>

<td width=\"150\" align=\"center\"><a href=\"../DUMP-TEXT/Anglais/$i.html\">PAGE DUMP</a></td>

<td width=\"150\" align=\"center\"><a href=\"../CONTEXTES/Anglais/$i.html\">PAGE CONTEXTE</a></td></tr>" >> $tablo;

let "i=i+1" ;

}

echo "</td></tr></table><tr><td bgcolor=\"white\"><iframe src=\"../NUAGES/contexte-liege-an-dic.TXT.html\" width=\"100%\" height=\"100%\"></iframe></td></tr></table></CENTER>" >> $tablo;

#

# Tableau 3

read fic3;

echo "<p><CENTER><table width=\"75%\" border=\"1\">" >> $tablo;

echo "<tr><td><CENTER><img src=\"../IMAGES/bouchonembouteillage.jpg\"></CENTER></td><td rowspan=\"2\"><table width=\"100%\" border=\"1\"><tr><td bgcolor=\"white\" colspan=\"4\"><CENTER>EMBOUTEILLAGE : traffic jam</CENTER></td></tr>" >> $tablo;

# Outils : Wget, lynx, egrep et cat.

for nom3 in `cat $fic3`

{

wget -rO ./PAGES-ASPIREES/Anglais/$i.html $nom3

lynx -dump -nolist $nom3 > ./DUMP-TEXT/Anglais/$i.html

egrep -i "\btraffic jam\b" ./DUMP-TEXT/Anglais/$i.html > ./CONTEXTES/Anglais/$i.html

cat ./CONTEXTES/Anglais/$i.html >> ./CONTEXTES/embouteillage-an.txt

echo "<tr><td width=\"150\" align=\"center\"><a href=\"$nom3\">URL $i</a></td>

<td width=\"150\" align=\"center\"><a href=\"../PAGES-ASPIREES/Anglais/$i.html\">PAGE ASPIREE</a></td>

<td width=\"150\" align=\"center\"><a href=\"../DUMP-TEXT/Anglais/$i.html\">PAGE DUMP</a></td>

<td width=\"150\" align=\"center\"><a href=\"../CONTEXTES/Anglais/$i.html\">PAGE CONTEXTE</a></td></tr>" >> $tablo;

let "i=i+1" ;

}

echo "</td></tr></table><tr><td bgcolor=\"white\"><iframe src=\"../NUAGES/contexte-embouteillage-an-dic.TXT.html\" width=\"100%\" height=\"100%\"></iframe></td></tr></table></CENTER>" >> $tablo;

#

# Tableau 4

read fic4;

echo "<p><CENTER><table width=\"75%\" border=\"1\">" >> $tablo;

echo "<tr><td><CENTER><img src=\"../IMAGES/bouchonlyonnais.jpg\"></CENTER></td><td rowspan=\"2\"><table width=\"100%\" border=\"1\"><tr><td bgcolor=\"white\" colspan=\"4\"><CENTER>RESTAURANT : bouchon</CENTER></td></tr>" >> $tablo;

# Outils : Wget, lynx, egrep et cat.

for nom4 in `cat $fic4`

{

wget -rO ./PAGES-ASPIREES/Anglais/$i.html $nom4

lynx -dump -nolist $nom4 > ./DUMP-TEXT/Anglais/$i.html

egrep -i "\bbouchon\b" ./DUMP-TEXT/Anglais/$i.html > ./CONTEXTES/Anglais/$i.html

cat ./CONTEXTES/Anglais/$i.html >> ./CONTEXTES/resto-an.txt

echo "<tr><td width=\"150\" align=\"center\"><a href=\"$nom4\">URL $i</a></td>

<td width=\"150\" align=\"center\"><a href=\"../PAGES-ASPIREES/Anglais/$i.html\">PAGE ASPIREE</a></td>

<td width=\"150\" align=\"center\"><a href=\"../DUMP-TEXT/Anglais/$i.html\">PAGE DUMP</a></td>

<td width=\"150\" align=\"center\"><a href=\"../CONTEXTES/Anglais/$i.html\">PAGE CONTEXTE</a></td></tr>" >> $tablo;

let "i=i+1" ;

}

# fin du fichier html

echo "</td></tr></table><tr><td bgcolor=\"white\"><iframe src=\"../NUAGES/contexte-resto-an-dic.TXT.html\" width=\"100%\" height=\"100%\"></iframe></td></tr></table></CENTER></body></html>" >> $tablo;