Run a command-line process with data sent, and retrieve the data.

Chris Katko ckatko at gmail.com
Fri Jun 10 17:40:12 UTC 2022


On Friday, 10 June 2022 at 17:37:30 UTC, Chris Katko wrote:
> I want to pipe in string data to a shell/commandline program, 
> then retrieve the output. But the documentation I read appears 
> to only show usage for 'Files' for stdin/stdout/stderr.
>
> ala something like this:
> ````D
> string input = "hello\nworld";
> string output;
> runProcess("grep hello", input, output);
> assert(output = "hello");
> ````

Okay that's probably incorrect grep, but you get the point.


More information about the Digitalmars-d-learn mailing list