My CSV file contains the information needed like this firstname,lastname,userid. I have 5 users which i need to parse from the CSV. In order to create the account assign to a group(group1) and assign encrypted temporary passwords. I've hit a wall, any help would be awesome. Thanks!
#!/bin/bash
OLDIFS=$IFS
IFS=","
while read firstname lastname userid
do
useradd -c "$firstname $lastname -d /home/$userid -G group1 -s /bin/bash $userid"
done
IFS=$OLDIFS
No users are being added from script execution.
useradd. I think you meant to put quotes around each parameter.