![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to create users on HP UX???? | mascotlee | UNIX Desktop for Dummies Questions & Answers | 8 | 07-20-2008 11:02 PM |
| interactive shell script to create users 10.4 | tlarkin | OS X (Apple) | 3 | 03-27-2008 11:35 AM |
| create users from template | rijeshpp | Shell Programming and Scripting | 0 | 10-31-2007 06:29 AM |
| FTP is using shell scripts create ? for file | a501420038 | Shell Programming and Scripting | 1 | 08-16-2007 11:39 AM |
| How do I create desktop icons for the shell programs I create??? | TRUEST | UNIX Desktop for Dummies Questions & Answers | 7 | 05-15-2002 08:40 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
shell scripts to create 100 users
Hello
i need a shell script to create 100 users i am running hp-ux......... startegy is something like this craete a shell script Code:
!/bin/ksh
counter=1
while [ $counter .le. 100 ]
do
{
useradd usr$counter
passwd usr$counter
# here begins my problem when i say passwd usr$counter
#it again prompts saying retype new passwd..how do i handle #this situation
counter=counter+1
}
done
hrishy added code tags for readability --oombera Last edited by oombera; 02-19-2004 at 01:18 PM. |
| Forum Sponsor | ||
|
|
|
|||
|
Use Expect. Expect is a tool for automating interactive applications such as telnet, ftp, passwd, fsck, rlogin, etc.
It is not default Unix tool(newest Linux distributions Contains Expect) you can download expect from: http://expect.nist.gov/ |
|
|||
|
I afraid I can't help you on that. May be someone else.
If you consider Perl, there is nice modules available for manipulating the passwd and shadow files. Such as: Unix::PasswdFile - Perl interface to /etc/passwd format files Passwd::Linux - Perl module for manipulating the passwd and shadow files These modules are available here. http://search.cpan.org/ |