Skip to main content

execute_command

Function execute_command 

Source
pub fn execute_command(cmd: &str, error_id: &str) -> ShellExecResult<String>
Expand description

Executes a shell command and returns a Result containing the command’s output

§Arguments

  • cmd - The shell command to execute
  • error_id - A unique identifier for debugging purposes

§Returns

  • Ok(String) - The stdout of the command if successful
  • Err(ShellError) - An error with diagnostic information if the command failed