From 35e579d2d3ab3595d2942424d3a7281fa4dcaa57 Mon Sep 17 00:00:00 2001 From: fangpeina Date: Mon, 2 Feb 2026 16:19:26 +0800 Subject: [PATCH] Documentation/nsh: Add stderr and stdin redirection documentation This commit updates the NSH documentation about redirection syntax. This documentation update corresponds to the stderr redirection feature added in nuttx-apps PR #3378. Signed-off-by: fangpeina --- Documentation/applications/nsh/nsh.rst | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Documentation/applications/nsh/nsh.rst b/Documentation/applications/nsh/nsh.rst index 3398e40f7e8..0b02ac55efa 100644 --- a/Documentation/applications/nsh/nsh.rst +++ b/Documentation/applications/nsh/nsh.rst @@ -89,23 +89,26 @@ Command Overview (NSH) is a simple shell application. NSH supports the following commands forms: -=============================== ====================================== +=============================== ========================================== Simple command ```` -Command with re-directed output `` > >> `` +Command with re-directed input `` < `` +Command with re-directed output `` > `` `` >> `` +Command with re-directed error `` 2> `` `` 2>> `` +Redirect stderr to stdout `` > 2>&1`` Background command `` &`` -Re-directed background command `` > & >> &`` -=============================== ====================================== +Re-directed background command `` > &`` `` >> &`` +=============================== ========================================== Where: * ```` is any one of the simple commands listed later. - * ```` is the full or relative path to any writable object in the file system name space (file or character driver). Such objects will be referred to simply as files throughout this document. + * ```` is the full or relative path to any readable or writable object in the file system name space (file or character driver). Such objects will be referred to simply as files throughout this document. ``nice`` **'d Background Commands**. NSH executes at the mid-priority (128). Backgrounded commands can be made to execute at higher or lower priorities using ``nice``:: - [nice [-d >]] [> |>> ] [&] + [nice [-d >]] [< ] [> |>> ] [2> |2>> |2>&1] [&] Where ```` is any value between -20 and 19 where lower (more negative values) correspond to higher priorities. The