Following the question at How to execute a command in a shell running as a child process?, I want to execute multiple commands.
let mut child = Command::new("sh").stdin(Stdio::piped())
.stderr(Stdio::piped())
.stdout(Stdio::piped())
.spawn()?;
child.stdin
.as_mut()
.ok_or("Child process stdin has not been captured!")?
.write_all(b"something...")?;
let output = child.wait_with_output()?;
Is it possible to do something like this?
.write_all(b"something...")?
.write_all(b"something...")?;