mirror of
https://github.com/arun11299/cpp-subprocess.git
synced 2025-08-05 12:56:23 -04:00
19 lines
377 B
C++
Executable File
19 lines
377 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 Hello");
|
|
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;
|
|
}
|