I've got a C program that reads from stdin and does some operations. I am asked to enter information periodically (every 20 sec), and leave the user interaction the same while doing some tests.
Is this possible without modifing the C program? I have already done a shell script that echoes the information periodically (to its stdout), so the idea is to connect this shell and the normal stdin to only one stdin (an inverse tee).
I tried (./periodic.sh; cat) > ./myprogram , which doesn't work because it is waiting the script to end (and the same the other way round).