16 std::optional<std::string>
exec(
const std::string& cmd)
18 std::array<char, 4096> buffer;
22 FILE* pipe = popen(cmd.c_str(),
"r");
29 while (fgets(buffer.data(), buffer.size(), pipe) != NULL)
31 result += buffer.data();
34 auto return_code = pclose(pipe);
40 result = ccf::nonstd::trim(result);