Unable to pass send command in shell script

I am trying to automate a testcase . I am installing some software and it waits for user input after displaying "Do you want to continue [Y/n]? " I am trying to do this in shell scripting.

#!/bin/bash
#!/usr/bin/expect -f
/usr/bin/expect << EOF
spawn apt-get install openjdk-7-jdk
expect "*Do you want to continue*"
send  "Y\r"
EOF
echo "hello"

In above code after spawn caommand executed it is waiting for expect. Once the expect is recieved i need to press enter but it skips that steps and printing echo.

Can anyone suggest me how to do this?
Thanks
Navaz

You cannot use two commando processors in one script. Either use bash or use expect.

I hope this helps.

bakunin