From 8cbd2fef56955302364eb25f4a8637aa1848e435 Mon Sep 17 00:00:00 2001 From: "jibril.bouhbas" Date: Thu, 8 Feb 2024 14:52:52 +0100 Subject: [PATCH] =?UTF-8?q?T=C3=A9l=C3=A9verser=20les=20fichiers=20vers=20?= =?UTF-8?q?"/"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- creatLogins.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 creatLogins.sh diff --git a/creatLogins.sh b/creatLogins.sh new file mode 100644 index 0000000..ba363f8 --- /dev/null +++ b/creatLogins.sh @@ -0,0 +1,14 @@ +#!/bin/bash +rm ./logins.csv +while read line +do +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