Skip to content

Instantly share code, notes, and snippets.

@clijsters
Created February 18, 2014 22:48
Show Gist options
  • Select an option

  • Save clijsters/9082095 to your computer and use it in GitHub Desktop.

Select an option

Save clijsters/9082095 to your computer and use it in GitHub Desktop.
Create multiple users from CSV input file
#!/bin/bash
USERFILE=/Pfad/Datei.csv
OLDIFS=$IFS
IFS=,
[ ! -f $INPUT ] && { echo "Datei $USERFILE nicht vorhanden."; exit 99; }
while read name passwort
do
adduser name --shell /bin/bash
echo passwort | passwd uname --stdin
done < $INPUT
IFS=$OLDIFS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment