#!/bin/bash while read line do touch ./temptp4.txt echo $line > ./temptp4.txt group=$(cut -d "," -f 5 ./temptp4.txt) user=$(cut -d "," -f 1 ./temptp4.txt) mdp=$(cut -d "," -f 2 ./temptp4.txt) if grep -q $group /etc/group ; then echo "ok" else echo "existe pas ; création" groupadd -f $group fi useradd $user --create-home --groups $group --shell /bin/bash echo "$user:$mdp" | chpasswd rm ./temptp4.txt done < logins.csv