diff --git a/createLogins.sh b/createLogins.sh new file mode 100644 index 0000000..b0275aa --- /dev/null +++ b/createLogins.sh @@ -0,0 +1,15 @@ +!/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 +