cpp-subprocess/main.cc
2016-03-17 11:51:11 +05:30

19 lines
388 B
C++
Executable File

#include "subprocess.hpp"
using namespace subprocess;
int main() {
auto p = Popen({"./script.sh"},
output{"out.txt"});
auto buf = check_output({"echo", "\"It works!\""});
std::cout << buf.buf.data() << " :: " << buf.length << std::endl;
buf = check_output("cat subprocess.hpp");
//std::cout << buf2.buf.data() << " :: " << buf2.length << std::endl;
//
return 0;
}