I have a c++ compiled code I can run, let call it run_process.
To describe run_process, it's a code which is waiting continuously (infinite loop/while True) for text input and make text preprocessing then print the preprocessed input in output:
I would like to know if I can make some command/request to send input/STDIN text to this running process and get the output text, for the moment I would like to avoid to edit run_process and find an "external" solution.
I tried the solution proposed here: https://serverfault.com/a/178470 and run:
echo "test" > /proc/2657677/fd/0
echo "test\n" > /proc/2657677/fd/0
echo -ne "test\n" > /proc/2657677/fd/0
And got this:
I don't get the output, it's like it can not simulate the ENTER key, or even just print the text next to "Input string" because when I press ENTER key I get nothing in output:
If you have any solution for this even using python or any other language, all solution will be interesting.
For more details, the code run_process use c++ readline function:
char* input = readline("Input string: ");
Line 90 from this: https://opengrm.org/doxygen/thrax/html/rewrite-tester-utils_8cc_source.html#l00245 and for more information you can see that the code I called "run_process" is actually in line 247.


