tools/scheduler/scheduler/executor/k3_executor.cpp
// exec -- exec system command, pipe to stdout, return exit code
- exec system command, pipe to stdout, return exit code
- exec system command pipe to stdout return exit code
int exec (const char * cmd)  {
  FILE* pipe = popen(cmd, "r");
    if (!pipe) {
        return -1;
    }
    char buffer[256];
    while (!feof(pipe)) {
        if (fgets(buffer, 256, pipe) != NULL) {
           std::string s = std::string(buffer);
           cout << s << endl;
        }
    }
    return pclose(pipe);
}
int exec ( const char * cmd ) { FILE * pipe = popen ( cmd , " " ) ; if ( ! pipe ) { return -1 ; } char buffer [ 256 ] ; while ( ! feof ( pipe ) ) { if ( fgets ( buffer , 256 , pipe ) != NULL ) { std :: string s = std :: string ( buffer ) ; cout << s << endl ; } } return pclose ( pipe ) ; }
exec -- exec system command, pipe to stdout, return exit code
exec -- exec system command pipe to stdout return exit code