send y /n to a procces after it´s running

Hello

I�m a senior Unix technician, i have a problem: I need send "y" and "enter" to a proccess that are running in memory. I explain that.

I have a server with Suse 10.3 that it�s runnig informix 11.10, this server are a backup server of a database server, to ensure the integrity of data y need execute a command "ontape -l" this command is interactive, and ask you to send a "yes enter" when you change the backup tape.

Mi problem is that command can interrup, because it�s change the state of database when it�s aborted, well i need make script to execute dayli that send "yes enter" to this proccess.

I try redirectin standard input, but this it�s only valid for one execution, example:

temp.txt
[status printer1
stop printer 2
]

serverBD:/DATA/LOGS # lpc < kk.txt
lpc> hpmater1:
printer is on device 'socket' speed -1
queuing is enabled
printing is enabled
no entries
daemon present
lpc> hpmater11:
printer is on device 'socket' speed -1
queuing is enabled
printing is enabled
no entries
daemon present

but this solution not solve my problem because, i need lpc running always

I try with jobs, making invoke call similar to:

echo "y \n"|fg pid

but I�m not capable to make it works

anyone have a idea?, how i can send "y n" to a proccess that have standar input in shell and can not be aborted never.

Very very thanks.

Maybe you can try to pipe the output of the yes command to your program, something like:

yes | yourprogram

thanks, but this not work, because yes send y continuisly, and I need only pass yes when I decide.

Today have found a solution, not for this, but i discoverd that ontpa -l can be used in this form ontape -l -C an this command not change the state of database, with this my problem is rosolved y can invoke ontape -l -C when i need.

Thanks for all