I am currently working on a similar issue but have solved it in part.
The answer depends upon where ("c" or "C-script" you want to do the re-direct) since you say it's a silly question, I'm not sure which you want to do.
I will give you the benefit of the doubt and assume you want to do it in a "c" compiled program.
Disclaimer: I received what I'm going to show you as a fax from IBM. so for legal purposes I want to give them credit. If you want the entire program, along with the entire legal disclaimer, contact IBM for the full program...It is called 'motalk.c'
at any rate, here is an excerpt that give the idea. Be aware that there is a bunch of 'setup' stuff required. The whole program is about 150 -200 lines of code. If you send me your E-mail address I can send you a copy of the entire program.
if(select(rfd, &afds, &afds, (fd_set *)0, (struct timeval *)0) < 0)
printf("Select failed - errno = %d\n", errno);
while ((num = read(rfd, buffer, 4096)) > 0)
write(fileno(stdout), buffer, num);
while ((num = read(fileno(stdin), buffer, 4096)) > 0)
write(fileno(fdw), buffer, num);
Now, for a question of my own...... How do you convince X-modem to accept input from somewhere other that stdin/stdout? Or, stated differently, how do I spawn a process whose stdin/stdout is already /dev/tty?
Also, if you could tell me how to 'post' inquiries myself, I would appreciate it.