enter password at prompt during a script?

I'm using rsync with the "-e ssh" option so of course it asks for a password using a prompt. Is there a way to tell a script to expect a prompt, wait for it, and give a password when it arrives?

There is a way to give rsync a password as part of its options using a file, but it only works with an rsync server not using ssh for the connection.

Two answers: "ssh-agent" or "expect"

Thanks, one of those will do it!