Interacting with the linux console
#This may not be the conceptually right place for this post, but I'm hoping for a solution which is a little portable( and wouldn't have to be changed with ..say..changing kernels..or using another flavour of unix) and is C++ friendly.#
Using the system command lets the user 'send' a command to the console and (as far as I know)..that is all , nothing more.
But suppose I want to implement a program which has to give a shell command, get back the response of the console in a string (when the console prompts for input)...and repeat the process.
What would be the best( or 'only' ) way to do so ?