Shell Script to Automate

I would like to automate script where i do not have to manually insert the username and password I wrote two different scripts but not able to achieve the results: here's to scripts i wrote

#!/bin/bash
cd /var/tmp
/home/server/steve/pca --askauth -idx
/opt/app/bin/expect <<EOF
expect "Please enter Sun Online Account User: "
send "username\r"
expect "Please enter Sun Online Account Password: "
send "password\r"

second script

#!/bin/sh
#cd /var/tmp
/home/server/steve/pca --askauth -idx
/opt/app/bin/expect <<EOF
expect {
"Please enter Sun Online Account User: "
send "username\r"
expect "Please enter Sun Online Account Password: "
send "password\r"

Can Anyone help???

Many Thanks
-sam

Please don't cross-post, I have answered in your other thread, in Shell programing and Scripting branch.