Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 03-20-2004, 03:21 AM   #1
LQ Newbie
Registered: Mar 2004
Posts: 18

Rep: Reputation: 0
Multi-users add for linux! Help me!!!!

My problem is that now I have a userlist.ext file which includes over 1000 peoples, the format is
Username:Password:Groupname:Fullname. Now I want to creat a script on linux redhat 9 and the script will read the userlist file and check the new user's information one by one.if the user information is valid, it will create the account for the user and write the account information to a report file,I want to the report file's format is User_fullname:Account_name:user_id:group_id;created_date
if the new user's information is invalid, it will not create the account for the user. and the error information will be reported to me.
Please give me some hints if you know!!
Old 03-20-2004, 06:39 AM   #2
Registered: Jun 2003
Location: Reading, UK
Distribution: Debian 3.0, LFS
Posts: 524

Rep: Reputation: 37
One word: Perl
It's designed for jobs like this. What do you mean by "valid user information"? If you list everything you need to check, I can help you write a script which would do the job (although I'm not a great programmer so it'll be messy, but it'll work).
Old 03-20-2004, 07:01 AM   #3
Senior Member
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120

Rep: Reputation: 45
As above, depends what you mean by "valid user information", should be fairly simple to parse each line in your existing file and output each line into a new file in the format that the newusers command can use to add all the users. It's probably better to use "valid" data from the outset then you are guaranteed it'll work rather than catch errors ad hoc as you go along.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Boot Multi Windows & Multi Linux olkar Linux - Newbie 5 10-03-2005 12:52 PM
Multi Boot Win98-WinXP add MEPIS olkar Linux - Newbie 5 05-23-2005 01:34 AM
Runlevel4 and multi-users? r_jensen11 Slackware 3 11-18-2003 10:59 PM
multi users on the same home directory rpinatel Linux - General 2 09-05-2003 12:55 PM
GRUB, Multi Linux/Multi Disk Boot gtnorton Linux - Software 1 03-16-2003 04:48 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:01 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration