From be4d18e8d741b6db613dbe163abc3140cf3b6ba1 Mon Sep 17 00:00:00 2001 From: WindSoilder Date: Mon, 23 Jun 2025 16:51:51 +0800 Subject: [PATCH] Make stderr usage clearer --- book/stdout_stderr_exit_codes.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/book/stdout_stderr_exit_codes.md b/book/stdout_stderr_exit_codes.md index 4e9b9352165..37f55356cc8 100644 --- a/book/stdout_stderr_exit_codes.md +++ b/book/stdout_stderr_exit_codes.md @@ -20,6 +20,12 @@ Without the pipeline, Nushell will not do any redirection, allowing it to print Another common stream that external applications often use to print error messages is stderr. By default, Nushell does not do any redirection of stderr, which means that by default it will print to the screen. +But you can do pass stderr to a command or a file if you want to: + +- use `e>|` to pass stderr to next command. +- use `e> file` to redirect stderr to a file. +- use `do -i { cmd } | complete` to capture stderr message. + ## Exit Code Finally, external commands have an "exit code". These codes help give a hint to the caller whether the command ran successfully.