diff --git a/src/uu/echo/src/echo.rs b/src/uu/echo/src/echo.rs index 947887210..b3707b6f8 100644 --- a/src/uu/echo/src/echo.rs +++ b/src/uu/echo/src/echo.rs @@ -175,7 +175,7 @@ fn execute(no_newline: bool, escaped: bool, free: &[String]) -> io::Result<()> { } if escaped { if print_escaped(input, &mut output)?.is_break() { - break; + return Ok(()); } } else { write!(output, "{input}")?; diff --git a/tests/by-util/test_echo.rs b/tests/by-util/test_echo.rs index dce5a4c95..875ff66cb 100644 --- a/tests/by-util/test_echo.rs +++ b/tests/by-util/test_echo.rs @@ -122,7 +122,7 @@ fn test_escape_no_further_output() { new_ucmd!() .args(&["-e", "a\\cb", "c"]) .succeeds() - .stdout_only("a\n"); + .stdout_only("a"); } #[test]