You could use "aliases" inside the bash shell, in case you want the "yes" command to do something with the word "yes", which is interpreted as a program which is not installed.
The way you want to supply an arg for 'app', is a bit non-standard.
Often, you could most likely supply arguments like this:
./app | perl -e 'print "Yes"'
I'm not sure if you can use this, but "xargs" may be what you are also looking for. Example command line:
find . | grep '.txt' | xargs cat
That would basically list all files (from the current directory recursively), show only those with .txt, and then "cat" each and one of them.
Basically, if you want to control this 'app', you need to either:
A) Run it and then redirect output, or pipe input into it like ./app | echo yes (or use python or perl for that sake), OR
B) Use a program or script infront of the APP, which supplies these "responses" to the program. E.g.:
./yes.py | app
yes.py contains the following code then:
You can of course, write a script that returns the response you give it, here's how you can do it in PHP:
<?php echo $argv; ?>
Then chmod +x response php
./response.php yes | app
Basically just another way