How to add new user and password through script

Hi Everybody

I want to write a script in solaris that will add user and set his password. How I will do that.

Moreover, if anybody knows where can i find documentation, material and downloads for sample scripts in solaris then please tell me.

Thanx

Ehsan

The simplest way is to use "expect".

Look at...

http://expect.nist.gov/