Created
February 18, 2014 22:48
-
-
Save clijsters/9082095 to your computer and use it in GitHub Desktop.
Create multiple users from CSV input file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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