scripting for recieving a prompt

I have to run a script provided by a vendor. Its an executable so I can't change it.

basically after I call it it prompts me for a password. The script does not provide a way for me to pass a password with the command that calls the script.

I would like to automate running this script from code and not have to require someone to login to executive it. Is it possible to right a shell script (I am on solaris in korn) that

  1. calls the script
  2. when prompted for the password, passes the password.
  3. It has to repeat the same password twice.

i am not sure if this will work but you can try.

#!/usr/bin/ksh

pwd ="ur_password"

ur_script $pwd $pwd

i am sure this will not work because i dont know how the command that will give input on a prompt.
probably masters here can give you a lot better way. i am just giving an idea.

passing the password does not work. the script won't run. if i do that. It just generates the allowable input.

Its an Oracle script for their middle tier. This is what happens when I try to pass a password. It just gives me the usage.

oidpasswd connect=oiddev unlock_su_acct=true -w $MYPASSWORD
Usage: oidpasswd [connect=<Net8 Connect Descriptor>] [change_oiddb_pwd=true | create_wallet=true | unlock_su_acct=true| reset_su_password=true | manage_su_acl=true]
connect: Database connect string
change_oiddb_pwd: Change OID database password
create_wallet: Create LDAP and Replication server wallets
unlock_su_acct: Unlock OID super user account
reset_su_password: Reset OID super user password
manage_su_acl: Manage super user restriced ACL

If I don't pass a password, I get a prompt as follows:

oidpasswd
current password:
new password:
confirm password:

You may need to use the expect language to inject a password in this fashion. Be careful not to pass passwords to anything as commandline parameters, as this is very insecure -- often anyone on the system will be able to read them in plaintext.

how do i use expect?

Here is the very second google hit for how to use expect.
Granted, there's much better ways to automate sftp than expect(i.e. keys) but it shows the idea nicely.