#include<stdio.h>
#include<string.h>
/**************************
*函数说明:获取shell程序的输出内容
*输入参数:
const char *commond,命令
char*buf,接收内容buf
int buf_len, 接受内容最大长度
*输出函数:无
**************************/
void runcmd(const char *commond, char*buf, int buf_len)
{
FILE *fp = NULL;
memset(buf, 0 ,buf_len);
fp = popen(commond,"r");
fread(buf, 1, buf_len, fp);
pclose(fp);
}