How to get the output of a system command in C?
The system function is handy. But how to get the output?
popen is a useful function for this purpose:
You can use normal file operation functions like fgets to read file content from the file opened by popen.