in reply to Controlling the shell...

If the autopasswd_oracle has an interactive mode, you could try to use Expect for inputting a username and password. Maybe using Expect to do the ssh isn't a bad idea in the first place if you are going to get user-input. It will give you more flexibility and ways to handle error situations.