I have an automatic script which works, only it just never makes a home directory. The data is extracted from a database.

Heres the script:

 $SQL -s -e "SELECT uid, password FROM registrations WHERE processed = 0"   \
    |  while read A B; do
            sudo useradd   $A -p $B -m 

as you can see the -m is there, but it seems to ignore it and never make a home directory and I have no idea why. I must be missing something but i've no idea what

share|improve this question
up vote 0 down vote accepted

Of course it will ignore it, useradd needs the login name at the end and the options at the start:

useradd [options] LOGIN

so it should looks like:

sudo useradd -p $B -m $A
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.