Is there a easier way to read the output of a Linux Shell Command like
ifconfig | grep "inet Adresse" | grep -v 127.0.0.1 | awk '{print $2}' | awk -F":" '{print $2}'
than using popen()
fp = popen(command, "r");
while(fgets(line, PATH_MAX, fp)!=NULL)
{
//someoperations
}
pclose(fp);
I need to get my info twice before and after some operations.
As my output is just one Line ?