Hi folks,
I am newbie to Linux programming but not a Linux newbie. I am writing a C program for gathering statistical data from remote Linux machines. I need to know how can I call other executables and store the results into a character array.
Example:
I want to obtain the total system memory status. If this was at the command line, I would writeand this will display the current memory status.Code:free -m
However, I want to be able to make this call from my C program and store the result into a character array.
I've looked into the exec set of functions but none of these allow me to store the output of the commands I pass as parameters into my character array.
Any help is appreciated!