Quote:
Originally Posted by aapanju
I need a script to create 400 users with serial numbers starting from 001 all the way to 400. They have to have UID 3001 to 3400 and all shud be in GID 9999. home directories should be /home/user001 all the way to /home/user400 and have a password expiery of 28 days. Either a script or any help would be great. Thanks
|
is this homework? for fear that it is, check out "man adduser"
you'll notice that all the options you need are there.
after that, you'll just need a little loop, kinda like (pseudo-esque code):
Code:
for i in 1 to 400
$ii = $i +3000
adduser <options>
end
being that you have $i going from 1-400 and $ii going from 3001-3401, it should be straight forward to see how to put this all together.
test with echos before you acually do it, i.e. instead of the adduser line, do something like
echo "adduser <options>"
and see that it prints out the command correctly.
Good luck!