This commit is contained in:
charlie.alves 2025-02-20 14:05:37 +01:00
parent 590b88c3fd
commit d6d9a7480f
2 changed files with 49 additions and 7 deletions

View File

@ -1,12 +1,24 @@
#!/bin/bash
fichier="./Users.csv"
fichier_a_lire=./Users.csv
fichier_a_ecrire=./logins.csv
while read ligne #définit la variable "ligne" comme le contenu de la ligne du fichier en cours de lecture
rm $fichier_a_ecrire 2> /dev/null #redirection eror
touch $fichier_a_ecrire
while read ligne
do
metier=$(echo $ligne | cut -d "," -f5)
if [[ $(grep $metier /etc/group) == "" ]] ; then
groupadd $metier
fi
aecrire=""
last_name=$(echo $ligne | cut -d "," -f2)
first_name=$(echo $ligne | cut -d "," -f1)
group=$(echo $ligne | cut -d "," -f5)
login=$(echo $first_name | cut -c1)$last_name
login=$(echo $login | tr [:upper:] [:lower:])
login=$(echo $login | tr -dc [:alnum:])
password=$(echo $RANDOM | md5sum | head -c8)
done < $fichier
aecrire="$login;$password;$first_name;$last_name;$group"
echo $aecrire >> $fichier_a_ecrire
done < $fichier_a_lire

View File

@ -0,0 +1,30 @@
eberthelmot;e40811bf;Ermengarde;Berthelmot;Accountant
kbunker;f7c22e79;Kassi;Bunker;Production
mmccallum;1a94ac35;Moises;McCallum;Production
plune;354deeb2;Patrizio;Lune;Accountant
beverix;0b3e22f6;Blanch;Everix;Accountant
skibbel;b67fc3a5;Stafani;Kibbel;Production
imosdell;6bc6d01a;Ignacius;Mosdell;Management
jwallerbridge;d016ba97;Jeana;Waller-Bridge;Management
edressel;6e944530;Elroy;Dressel;Production
tstrettell;5fab7edd;Thea;Strettell;Production
sinsoll;aca94206;Solomon;Insoll;Accountant
cfeedome;a58d78cc;Carri;Feedome;Accountant
pchetwind;d8ceaea7;Padraic;Chetwind;Management
sdugo;e261627f;Solly;D'Ugo;Production
kmaccostigan;3e1a2f8f;Konstanze;MacCostigan;Accountant
rpowlesland;b582f1d8;Roxane;Powlesland;Management
okennealy;59314200;Orelle;Kennealy;Production
ssoitoux;0c829d63;Sukey;Soitoux;Production
nsyce;be620e2e;Nelli;Syce;Production
cshillam;218e2a58;Clarisse;Shillam;Production
cgueny;198d5102;Carin;Gueny;Management
driepel;771346ac;Donny;Riepel;Production
dralfe;8a32161d;Daniella;Ralfe;Production
lclynmans;62f95d53;Lexy;Clynmans;Production
gadamthwaite;21deffaf;Gardiner;Adamthwaite;Production
wlippett;f8a31803;Woodman;Lippett;Production
nmunnion;198abaff;Nadya;Munnion;Production
lhabershon;4abe7ab1;Llewellyn;Habershon;Production
igreatrex;ce9459a4;Isaak;Greatrex;Production
dfrostdyke;a5626494;Darill;Frostdyke;Production
1 eberthelmot e40811bf Ermengarde Berthelmot Accountant
2 kbunker f7c22e79 Kassi Bunker Production
3 mmccallum 1a94ac35 Moises McCallum Production
4 plune 354deeb2 Patrizio Lune Accountant
5 beverix 0b3e22f6 Blanch Everix Accountant
6 skibbel b67fc3a5 Stafani Kibbel Production
7 imosdell 6bc6d01a Ignacius Mosdell Management
8 jwallerbridge d016ba97 Jeana Waller-Bridge Management
9 edressel 6e944530 Elroy Dressel Production
10 tstrettell 5fab7edd Thea Strettell Production
11 sinsoll aca94206 Solomon Insoll Accountant
12 cfeedome a58d78cc Carri Feedome Accountant
13 pchetwind d8ceaea7 Padraic Chetwind Management
14 sdugo e261627f Solly D'Ugo Production
15 kmaccostigan 3e1a2f8f Konstanze MacCostigan Accountant
16 rpowlesland b582f1d8 Roxane Powlesland Management
17 okennealy 59314200 Orelle Kennealy Production
18 ssoitoux 0c829d63 Sukey Soitoux Production
19 nsyce be620e2e Nelli Syce Production
20 cshillam 218e2a58 Clarisse Shillam Production
21 cgueny 198d5102 Carin Gueny Management
22 driepel 771346ac Donny Riepel Production
23 dralfe 8a32161d Daniella Ralfe Production
24 lclynmans 62f95d53 Lexy Clynmans Production
25 gadamthwaite 21deffaf Gardiner Adamthwaite Production
26 wlippett f8a31803 Woodman Lippett Production
27 nmunnion 198abaff Nadya Munnion Production
28 lhabershon 4abe7ab1 Llewellyn Habershon Production
29 igreatrex ce9459a4 Isaak Greatrex Production
30 dfrostdyke a5626494 Darill Frostdyke Production