async-rs / async-rs/async-std

Piping output from one command into another command

Open
#942 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
4.1k
Forks
339
PR merge metrics
No merged PRs in 30d

Description

It's there a way of piping the output of a command into another? I'm trying to make this example working. But the `stdin` method expect a type `T: Into` as parameter. The following example would work if I used `std::process::Command`.
```rust
let child = async_std::process::Command::new("ls")
.stdout(async_std::process::Stdio::piped())
.spawn()?;
async_std::process::Command::new("grep")
.arg("a")
.stdin(child.stdout.unwrap())
.spawn()?;
```
I get the following error:

```the trait bound `Stdio: From` is not satisfied [...]```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.