I have a C++ application, to which i need to send an End of Transmission signal.
I can do a Ctrl+D on the console, but when I try that within
One way you might consider sending ctrl+d to the console is by doing a little BASH injection in your program arguments. appending something like "& sleep 10 && echo -e '\x04\c' > /dev/stdin" for example will wait 10 seconds before sending the ctrl-D command. though you could easily modify it for some other non-timebased condition as well. In addition, you could open /dev/stdin from your C++ program as a file, then write the value 0x04 into it then flush to achieve the same effect from your program.