I'm not able to get the output of command in text file when running this executable of '.c' file:
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.