LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 03-03-2008, 10:13 AM   #1
cmontr
Member
 
Registered: Sep 2007
Posts: 175

Rep: Reputation: 15
shell script for many user add


Hi - Could anyone help for this please?

How to add over 500 users listed in a text file with a shell script ?

Thank you very much in advance
 
Old 03-03-2008, 10:19 AM   #2
cmontr
Member
 
Registered: Sep 2007
Posts: 175

Original Poster
Rep: Reputation: 15
I tried this...Is there any other methods you can suggest ?

Thnx

------------

#!/usr/bin/ksh

NEW_USERS="/txt_file"
HOME_BASE="/home/"

cat ${NEW_USERS} | \
while read USER PASSWORD GROUP
do
useradd -g ${GROUP} -p ${PASSWORD} -m -d ${HOME_BASE}${USER} ${USER}
done
 
  


Reply


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 add new user via shell script Ingenico1 Linux - Software 3 10-05-2008 03:14 PM
samba - add user script - User account does not exist itzamecwp Linux - Server 2 01-18-2007 10:52 PM
how to add user in command shell man_J Linux - Software 4 11-05-2006 08:09 AM
Add a user thorugh SHELL? mikeshn Linux - General 4 01-08-2003 10:31 PM
Add User Shell Script DAC Programming 2 10-13-2002 03:12 PM


All times are GMT -5. The time now is 08:42 AM.

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