-
I have a use case where I need to run shell commands with multiple pipes in it, for example -
This is used for getting the last password change of a user, now if I pass these as args it doesn't work, what's the best way for this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
To do this, you have to create each process separately. To set up the pipes, you need to set the stdout of each to piped, then convert the There's an example of how to do it in this test: tokio/tests-integration/tests/process_stdio.rs Lines 146 to 192 in 96370ba |
Beta Was this translation helpful? Give feedback.
To do this, you have to create each process separately. To set up the pipes, you need to set the stdout of each to piped, then convert the
ChildStdout
object to aStdio
object that you use as the stdin of the next child.There's an example of how to do it in this test:
tokio/tests-integration/tests/process_stdio.rs
Lines 146 to 192 in 96370ba