login from script

Dear All,

I am writing a shell script in which I would like to rum some commnads as another user. Is it possible to switch user's login inside the shell? let me elaborate my question-

I logged in as user AAA

now I want to be user BBB

I am aware of su -c command but I don't know how to specify a pssword in this.

Note: AAA is an ordinary user not a super user.

Regards

Gaurav

[434 byte] By [gauravsharan] at [2007-11-25 23:19:03]
# 1
Use expect
dwlahiri at 2007-7-5 18:07:17 > top of Java-index,General,Talk to the Sysop...