29 lines
481 B
Bash
29 lines
481 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
FILENAME="index.html"
|
||
|
echo "<ul>" > $FILENAME
|
||
|
|
||
|
lien='<li> <a href="http://192.168.230.4/~{id}"> ${np} </a> </li>'
|
||
|
|
||
|
|
||
|
OLDIFS=$IFS
|
||
|
IFS=","
|
||
|
while read nom prenom
|
||
|
do
|
||
|
echo "Création de $prenom $nom"
|
||
|
id="${prenom:0:1}${nom}"
|
||
|
id=${id,,}
|
||
|
|
||
|
#sed_id='s/${id}/'$id'/'
|
||
|
#sed_np='s/${np}/'$nom $prenom'/'
|
||
|
|
||
|
#echo $lien | sed -e $sed_id -e $sed_np >> $FILENAME
|
||
|
ligne=${lien//{id}/$id}
|
||
|
echo $ligne
|
||
|
|
||
|
done < $1
|
||
|
|
||
|
echo "</ul>" >> $FILENAME
|
||
|
|
||
|
IFS=$OLDIFS
|