[olug] password change one liner shell script

Kenton Brede xyf at nixnotes.org
Fri Sep 5 16:54:07 UTC 2003


On Fri, Sep 05, 2003 at 11:40:25AM -0500, Derek & Lisa wrote:
> I want to set a user password all in one line, not by interactive prompt. 
> (bash shell script)
> 
> passwd username | sleep 1s && echo $passwordvariable |  echo $passwordvariable
> 
> Something like that, but that actually works and enters the password twice.
> 
> any ideas?
> 

expect could be used for this.
http://expect.nist.gov/
Kent

-- 
"I am always doing that which I can not do, 
   in order that I may learn how to do it." --Pablo Picasso



More information about the OLUG mailing list