Create users

Please support our Shell Scripting advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Apr 2008
Posts: 6
Reputation: vishwajit is an unknown quantity at this point 
Solved Threads: 0
vishwajit vishwajit is offline Offline
Newbie Poster

Create users

 
0
  #1
Apr 12th, 2008
Hi
Can anyone help on how to add passwords to already created users non-interactively in shell script.
Passwords will be stored in one text file. Script should automatically take passwords from file.

Thanks in Advance
Vishwajit
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 399
Reputation: eggi will become famous soon enough eggi will become famous soon enough 
Solved Threads: 47
eggi eggi is offline Offline
Posting Whiz

Re: Create users

 
0
  #2
Apr 12th, 2008
Hey There,

You can do it if your implementation of passwd accepts input from STDIN. Just run through a while loop, like

Shell Scripting Syntax (Toggle Plain Text)
  1. while read input
  2. do
  3. passwd code here
  4. done <input

Hope that helps

, Mike
Linux and Unix Tips, Tricks and Individual Advice - The Linux and Unix Menagerie!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 6
Reputation: vishwajit is an unknown quantity at this point 
Solved Threads: 0
vishwajit vishwajit is offline Offline
Newbie Poster

Re: Create users

 
0
  #3
Apr 14th, 2008
Thanks Eggi
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 399
Reputation: eggi will become famous soon enough eggi will become famous soon enough 
Solved Threads: 47
eggi eggi is offline Offline
Posting Whiz

Re: Create users

 
0
  #4
Apr 14th, 2008
Glad to help

, Mike
Linux and Unix Tips, Tricks and Individual Advice - The Linux and Unix Menagerie!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the Shell Scripting Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC