Calling system() if certain text appears on the screen.

Hi.

I'm wondering if it is possible to execute system(), if a certain string of text appears on the screen or not?
I want to be able to run system("rz -Z") based on if "B00000000000000" appears on the screen.
rz is a program to recieve files via Zmodem protocol. Is this possible? In C, of course.

Any help and/or input is greatly appreciated.

I don't see why not. "appears on screen" means basically it is part of the output stream of your tty device - intercept that and you will be able to notice when the string appears there. You will also have to find out which terminal you are attached to.

I hope this helps.

bakunin

Thanks for the reply. Would popen() be of any use?

Ok. Solved it. Basically used getchar() to get user input to initiate Zmodem download.