change password in one go

Hi all,

I need to change the password of any user in one go.

For example in Linux we have two options :-

(echo "username:password") | chpasswd
or
echo $PASS | passwd $USER --stdin

This changes the password without prompting. Actually, I need to make a script which adds a user and then sets a password to it.

I have made it for Linux but now I require it to run on other Unix boxes also. I dont have option to install any other utility like expect. :frowning:

Pls can someone give Solaris + HPUX + AIX equivalent of the command.

Thanks in adv.

VIKAS

Why do you have to create +2 duplicate posts ?

http://www.unix.com/hp-ux/68428-change-password-one-go.html\#post302203343

hey,

Sorry about it. But I had posted it in different forums as these are OS specific forums.

Will take care in future.

Please do NOT crosspost your questions! I've moved the tread to shell scripting.

OK !!!!!!!!!!

please read the rules...