On Saturday, 18 November 2023 at 18:09:53 UTC, BoQsc wrote:
Latest iteration on this thread.
Limitations:
* pipes through two programs.
* very verbose, hard to use.
What exactly are you trying to achieve?
```
import std;
import std.process;
version (Windows) { enum Find = "find"; }
Latest iteration on this thread.
Limitations:
* pipes through two programs.
* very verbose, hard to use.
```
import std;
import std.process;
version (Windows) { enum Find = "find"; }
version (Posix) { enum Find = "grep"; }
void pipeTo(Pipe p, string nextprogram){
On Saturday, 11 November 2023 at 17:29:14 UTC, BoQsc wrote:
https://dlang.org/library/std/process.html
How do I pipe (|) through three programs using std.process?
https://dev.to/jessekphillips/piping-process-output-1cai
Your issue with [Find, "Hello"] might be
[Find, "\"Hello\""]
But I'm
To make this thread more complete, here is the final version.
```
import std.stdio;
import std.process;
version (Windows) { enum Find = "find"; }
version (Posix) { enum Find = "grep"; }
int main (string [] args)
{
auto p1 = pipe;
auto p2 = pipe;
auto pid1 = spawnShell("echo
On Sunday, 12 November 2023 at 13:39:25 UTC, BoQsc wrote:
However the question of why `spawnProcess(["find", "string to
find"]` is not working and produces error is still unresolved.
spawnProcess always encodes its arguments in a very specific way
and the receiving programs are not always
Using `spawnShell` it all seem to work.
However the question of why `spawnProcess(["find", "string to
find"]` is not working and produces error is still unresolved.
Works with `spawnShell`:
```
import std.stdio;
import std.process;
version (Windows) { enum Find = "find"; }
version (Posix) {
On Windows:
While trying to use `spawnshell` I discovered that I can not use
any alphabetical letters inside the `spawnProcess([Find,
"Hello"])` it all works when they are numerical `[Find, "6515"]`.
As of recent testing `[Find, "df123"]` also is acceptable,
but not when letter is on the
On Saturday, 11 November 2023 at 17:29:14 UTC, BoQsc wrote:
https://dlang.org/library/std/process.html
How do I pipe (|) through three programs using std.process?
```
echo This is a sample text | find "sample" | find "text"
```
```d
import std.stdio;
import std.process;
version (Windows) {