orabona/create_users/html_pres.sh

29 lines
481 B
Bash
Raw Permalink Normal View History

2014-01-07 15:55:06 +00:00
#!/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