useradd

I want to creat a 27 logins in solaris.Can anyone tell me how to write a script for that so that i create at a time for all 27 people.

Thanks to guide me.

#!/usr/bin/bash
uid=user
i=1
numusr=27
grp=users
groupadd $mygroup
while [ $i -le $numusr ]
do
useradd  -d /export/home/$uid$i -m -s /usr/bin/ksh 
i=$i + 1
done

THANKS.
So what will be the names of useid? i have useid names with me so how to add it that to scrpit?
And i need gid of all user as 100 only.
Iam new to this scripting thanks to hepl:)

user names will be user1 , user2 , user20 and so forth .
if you mean user uid they will be a sequence of numeric values which starts with the last uid taken and ends with the last user that were created.

what does groupadd mean here?
and after creating 27 logins i ask all 27 user to chage login names to there want.is it possible?

Hello,

For the last time...

Per our forum rules, all threads must have a descriptive subject text. For example, do not post questions with subjects like "Help Me!", "Urgent!!" or "Doubt". Post subjects like "Execution Problems with Cron" or "Help with Backup Shell Script".

The reason for this is that nearly 95% of all visitors to this site come here because they are referred by a search engine. In order for future searches on your post (with answers) to work well, the subject field must be something useful and related to the problem!

In addition, current forum users who are kind enough to answer questions should be able to understand the essence of your query at first glance.

So, as a benefit and courtesy to current and future knowledge seekers, please be careful with your subject text. You might receive a forum infraction if you don't pay attention to this.

Thank you.

The UNIX and Linux Forums