All pastes #512666 Raw Edit

tymop

public text v1 · immutable
#512666 ·published 2007-05-27 00:01 UTC
rendered paste body
dossier='/media/Documents/jeux_flash'
f_html=${dossier}/a.html
f_htm2=${dossier}/ab.html
f_tree=${dossier}/.arbre


colmax=6

clear
rm -f ${f_html}
rm -f ${f_htm2}
rm -f ${f_tree}

cd $dossier

echo -e "\n\n<table><caption><h1>Liste des Jeux ${sousdossier}</h1></caption><tbody align="center" valign="center">" >> ${f_htm2}

for  sousdossier in *
do

	echo -e "\n\n$sousdossier" >> ${f_tree}
	echo -e "\n\n<div align="left"><h3><strong><a href='$sousdossier/'>jeux de ${sousdossier}</a><br /></strong></h3></div>"  >> ${f_html}
#	echo -e "\n\n<table><h3><caption>Liste des Jeux de ${sousdossier}</caption></h3><tbody align="center" valign="center">" >> ${f_htm2}
	echo -e "<tr> </tr>" >> ${f_htm2}
	echo -e "<tr><td></td><td></td><td><h3><strong>Liste des Jeux de ${sousdossier}</h3></strong></td></tr>" >> ${f_htm2}

	colonne=0
	for fichier in ${sousdossier}/*
		do
		nom_fichier=`echo ${fichier} | sed 's/'${sousdossier}'\///' | sed 's/\.swf//'`

		if [ ${colonne} -eq 0 ] ; then 
			echo -e "\n  <tr><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 "\n  <td><a href='${fichier}'>${nom_fichier}</a></td>"  >> ${f_htm2}
				colonne=$(( $colonne + 1 ))
			fi
		elif [ ${colonne} -eq ${colmax} ] ; then 
			echo -e "\n  <td><a href='${fichier}'>${nom_fichier}</a></td></tr>"  >> ${f_htm2}
			colonne=0
		fi
				

		
		
		echo ${sousdossier}/${fichier} >> ${dossier}/.arbre
		echo "&nbsp;&nbsp;<a href='${fichier}'>${nom_fichier}</a><br />"  >> ${f_html}

		

		
		done
	echo -e "</tr>"  >> ${f_htm2}

done
exit 0