rendered paste bodydossier='/media/Documents/jeux_flash'
f_html=${dossier}/liste.html
f_htm2=${dossier}/Liste_de_jeux.html
f_tree=${dossier}/.arbre
colmax=6
#clear
rm -f ${f_htm2}
rm -f ${f_tree}
cd $dossier
for sousdossier in *
do
echo -e "\n\n$sousdossier" >> ${f_tree}
echo -e "<br><br/>\n<table border='5' width='800' ><caption><h3>Liste des Jeux de ${sousdossier}</h3></caption>" >> ${f_htm2}
echo -e " <tbody align="center" valign="center" bgcolor="lightGray" >" >> ${f_htm2}
colonne=1
for fichier in ${sousdossier}/*
do
nom_fichier=`echo ${fichier} | sed 's/'${sousdossier}'\///' | sed 's/\.swf//'`
if [ ${colonne} -eq 1 ] ; then
echo -e "\n <tr width="100" >\n <td><a href='${fichier}'>${nom_fichier}</a></td>" >> ${f_htm2}
colonne=$(( $colonne + 1 ))
elif [ ${colonne} -ge 0 ] ; then
if [ ${colonne} -lt ${colmax} ] ; then
echo -e " <td><a href='${fichier}'>${nom_fichier}</a></td>" >> ${f_htm2}
colonne=$(( $colonne + 1 ))
elif [ ${colonne} -eq ${colmax} ] ; then
echo -e " <td><a href='${fichier}'>${nom_fichier}</a></td>\n </tr>" >> ${f_htm2}
colonne=1
fi
fi
echo ${fichier} >> ${f_tree}
done
echo -e " </tr>\n\n" >> ${f_htm2}
done
echo "Fichier Terminé"
exit 0