44 lines
801 B
Bash
44 lines
801 B
Bash
|
#!/bin/sh
|
||
|
IFS="
|
||
|
"
|
||
|
|
||
|
lieu_fiches="lecons_notes"
|
||
|
|
||
|
|
||
|
if [ ! -e $lieu_fiches ]
|
||
|
then
|
||
|
echo "Création du répertoire"
|
||
|
mkdir $lieu_fiches
|
||
|
fi
|
||
|
|
||
|
|
||
|
for lecon in `cat liste_lecon`; do
|
||
|
numero=${lecon:0:3}
|
||
|
nom=${lecon:5} # On extrait le nom de la lecon
|
||
|
nom_mod=${nom//./} # On remplace les "." par rien
|
||
|
nom_mod=${nom_mod// /_} # On remplace les espaces par des _
|
||
|
echo "Création de $lecon"
|
||
|
|
||
|
fichier="$lieu_fiches/$numero"
|
||
|
|
||
|
printf "<?xml version=\"1.0\" encoding=\"iso-8859-1\" standalone=\"yes\"?>
|
||
|
|
||
|
<lecon num=\"%s\" nom=\"%s\">
|
||
|
|
||
|
|
||
|
</lecon>
|
||
|
|
||
|
<!-- Syntaxe
|
||
|
|
||
|
Commentaires sur la lecon
|
||
|
<com src=str > </com>
|
||
|
|
||
|
Developpements choisis ou vus ou n'importe quoi
|
||
|
<dev src=str pg=int > </dev>
|
||
|
|
||
|
Bouquins indispensables
|
||
|
<book src=str pg=int > <book>
|
||
|
-->
|
||
|
" $numero $nom > $fichier
|
||
|
|
||
|
done
|