Help with script to create users from database query

view story

http://www.unix.com – Code: #!/bin/bash user=`mysql userList -uuserlist -puserlistpassword -s -N -e "SELECT userName FROM users WHERE activated='n'"` for i in $user; do useradd "$i" -m done This is what I have done so far. But obviously it still does not work. I'm trying to create users based on information stored in a database. At the moment I'm just concentrating on creating users. But would like to add passwords as well. Anybody able to point me in the right direction EDIT: I'm very new to bash scripting as well. Hence why I'm struggling. Many thanks Bucket (HowTos)