How can invoke an automatic "Y" in a script?

I have a small script:
--------------------
mt rewind          
dd if=/dev/rmt/0n of=/dev/null  
/app_dsk/usr/dlc/bin/prorest apmdb /dev/rmt/0n
--------------------

it is called by running the filename:
--------------------
apmdb.rest
--------------------
Problem is, that the program the script runs, always asks the question:
File Exists, Overwrite? (Y/N)
I have to manually press "Y" everytime.
How can I make the "Y" be entered automatically without me doing it?
rbendAsked:
Who is Participating?
 
NukfrorCommented:
Use a HERE document in Bourne shell:

sh apmdb.rest <<ENDHERE
Y
ENDHERE

The ENDHERE part is simply something you choose - ENDHERE is what I've always used.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.