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 executeinput- Data to write to the command’s stdintimeout- 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.