Function mrpt::system::executeCommand

Function Documentation

int mrpt::system::executeCommand(const std::string &command, std::string *output = nullptr, const std::string &mode = "r")

Execute Generic Shell Command.

Note

Original code snippet found in http://stackoverflow.com/a/30357710

Parameters:
  • command[in] Command to execute

  • output[out] Pointer to string containing the shell output

  • mode[in] read/write access

Returns:

0 for success, -1 otherwise.