16 lines
393 B
Bash
16 lines
393 B
Bash
!/bin/bash
|
|
rm ./logins.csv
|
|
while read line
|
|
do
|
|
touch ./tem.txt
|
|
echo $line > ./tem.txt
|
|
prenom=$(cut -d "," -f 1 ./tem.txt)
|
|
nom=$(cut -d "," -f 2 ./tem.txt)
|
|
initial=$(cut -c 1 ./tem.txt)
|
|
id=$(echo $initial$nom |tr [:upper:] [:lower:])
|
|
passwd=$(echo $RANDOM| md5sum | head -c 8)
|
|
echo $id","$passwd","$prenom","$nom","$(cut -d"," -f 5 ./tem.txt)"," >> ./logins.csv
|
|
rm ./tem.txt
|
|
done < ./Users.csv
|
|
|