运行“.c”文件的可执行文件时,我无法在文本文件中获取命令的输出:
char image_upload_cmd[100] = {'\0'};
sprintf(image_upload_cmd, "mcumgr conn show > /home/sample/statfile.txt");
system(image_upload_cmd);
--> mcumgr command exists in '/usr/bin/'.
--> conn, show are options to that command.