From d99426d6070c21bfdd61784d2ddc864628f23ede Mon Sep 17 00:00:00 2001 From: "jeremy.thomas" Date: Thu, 20 Feb 2025 14:12:44 +0100 Subject: [PATCH] vfini_ --- sisr1/tp04_scripts_admin/createLogins.sh | 33 ++++++++----- sisr1/tp04_scripts_admin/logins.csv | 60 ++++++++++++------------ 2 files changed, 51 insertions(+), 42 deletions(-) diff --git a/sisr1/tp04_scripts_admin/createLogins.sh b/sisr1/tp04_scripts_admin/createLogins.sh index 821789b..933ba29 100644 --- a/sisr1/tp04_scripts_admin/createLogins.sh +++ b/sisr1/tp04_scripts_admin/createLogins.sh @@ -1,25 +1,34 @@ #!/bin/bash -fichier_a_lire='./Users.csv' -fichier_a_ecrire='./logins.csv' +file='./Users.csv' +loginfile='./logins.csv' # Suppression du fichier -rm $fichier_a_ecrire 2> /dev/null # Redirection des erreurs +rm $loginfile 2> /dev/null # Redirection des erreurs # Création du fichier login.csv -touch $fichier_a_ecrire +touch $loginfile while read ligne do - aecrire="" + writelogin="" # A chaque itération, stocker le prénom dans $prenom - prenom=$(echo $ligne | cut -d "," -f1) + first_name=$(echo $ligne | cut -d "," -f1) # A chaque itération, stocker le nom dans $nom - nom=$(echo $ligne | cut -d "," -f2) - # A chaque itération, stocker le métier dans $metier + last_name=$(echo $ligne | cut -d "," -f2) + # A chaque itération, stocker le groupe utilisateur dans $group group=$(echo $ligne | cut -d "," -f5) - login=? - password=$(tr -dc A-Za-z0-9 > $fichier_a_ecrire -done < $fichier_a_lire + # A chaque itération, stocker les informations récupéraient précédement dans $writelogin + writelogin="$login;$password;$first_name;$last_name;$group" + + echo $writelogin >> $loginfile +done < $file diff --git a/sisr1/tp04_scripts_admin/logins.csv b/sisr1/tp04_scripts_admin/logins.csv index 975a9c2..18f2e33 100644 --- a/sisr1/tp04_scripts_admin/logins.csv +++ b/sisr1/tp04_scripts_admin/logins.csv @@ -1,30 +1,30 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +eberthelmot;fbg3nGCr;Ermengarde;Berthelmot;Accountant +kbunker;9BzXt6Xm;Kassi;Bunker;Production +mmccallum;hV3TRJ73;Moises;McCallum;Production +plune;oSfQHuvg;Patrizio;Lune;Accountant +beverix;2f7B6btu;Blanch;Everix;Accountant +skibbel;bVj3HByx;Stafani;Kibbel;Production +imosdell;GJ1sNsGp;Ignacius;Mosdell;Management +jwallerbridge;8ih7RbsF;Jeana;Waller-Bridge;Management +edressel;Bw2xaoqL;Elroy;Dressel;Production +tstrettell;qJnW4Qup;Thea;Strettell;Production +sinsoll;2Kv0LM1x;Solomon;Insoll;Accountant +cfeedome;yoxs6ala;Carri;Feedome;Accountant +pchetwind;95n2yWyF;Padraic;Chetwind;Management +sdugo;RWM6KyGw;Solly;D'Ugo;Production +kmaccostigan;mZ2bsgTg;Konstanze;MacCostigan;Accountant +rpowlesland;0MSFqeGE;Roxane;Powlesland;Management +okennealy;3Wa2lRuz;Orelle;Kennealy;Production +ssoitoux;vctbRwz9;Sukey;Soitoux;Production +nsyce;X6v2Z4iA;Nelli;Syce;Production +cshillam;4bbmoVDK;Clarisse;Shillam;Production +cgueny;EuSp7vrP;Carin;Gueny;Management +driepel;7c6bSIyH;Donny;Riepel;Production +dralfe;d0uYqva6;Daniella;Ralfe;Production +lclynmans;JXUvA7DR;Lexy;Clynmans;Production +gadamthwaite;TryAdrjv;Gardiner;Adamthwaite;Production +wlippett;uME9caqd;Woodman;Lippett;Production +nmunnion;pBfKA2AO;Nadya;Munnion;Production +lhabershon;FoDzxdD9;Llewellyn;Habershon;Production +igreatrex;tOhtpET4;Isaak;Greatrex;Production +dfrostdyke;H18DkhbJ;Darill;Frostdyke;Production