4 of 4 deleted 6 characters in body

How do I automatically answer y in bash script?

I want to uninstall some program via a bash script. After I run the command, the terminal asking me if I am sure that I want to uninstall it. So I need to answer y. I want to do it automatically and answer y after delay of 10 seconds.

I did this example but it's not working -

sleep 10
echo "y"

Any idea? Centos 7.2