Run process with string input and output
问题 There are plenty of questions on here related to fork() and exec(). I have not found one that really makes the process of using them simple though, and making programmer's lives simple is the goal. I need a C++, linux-friendly function that does the following: string RunCommand(string command, string input){} This function should be able to run a shell command, like grep, and "pipe" the content of input into it and read the ouptut and return it. So if I would do the following at the command