Skip to main content

run_piped

Function run_piped 

Source
pub fn run_piped(
    command_str: &str,
    input: &str,
    timeout: Option<Duration>,
) -> Result<String, ShellError>
Expand description

Execute a shell command with the given input piped to stdin.

Returns the command’s stdout on success.

§Arguments

  • command_str - The shell command to execute
  • input - Data to write to the command’s stdin
  • timeout - Optional timeout; if exceeded, the process is killed

§Notes

The entire stdout is buffered in memory before being returned. For very large outputs (multi-megabyte), consider streaming alternatives.