SyntaxFix
Write A Post
Hire A Developer
Questions
Also you can pipe the answers to the script:
printf "y\npassword\n" | sh test.sh
where \n is escape-sequence
\n