All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] doc: document echo command
@ 2021-01-21 17:55 Heinrich Schuchardt
  2021-01-24  2:03 ` Simon Glass
  0 siblings, 1 reply; 2+ messages in thread
From: Heinrich Schuchardt @ 2021-01-21 17:55 UTC (permalink / raw)
  To: u-boot

Provide a man-page for the echo command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 doc/usage/echo.rst  | 65 +++++++++++++++++++++++++++++++++++++++++++++
 doc/usage/index.rst |  1 +
 2 files changed, 66 insertions(+)
 create mode 100644 doc/usage/echo.rst

diff --git a/doc/usage/echo.rst b/doc/usage/echo.rst
new file mode 100644
index 0000000000..e11c35c2a9
--- /dev/null
+++ b/doc/usage/echo.rst
@@ -0,0 +1,65 @@
+echo command
+============
+
+Synopsis
+--------
+
+::
+
+    echo [-n] [args ...]
+
+Description
+-----------
+
+The echo command prints its arguments to the console separated by spaces.
+
+-n
+    Do not print a line feed after the last argument.
+
+args
+    Arguments to be printed. The arguments are evaluated before being passed to
+    the command.
+
+Examples
+--------
+
+Strings are parsed before the arguments are passed to the echo command:
+
+::
+
+    => echo "a" 'b' c
+    a b c
+    =>
+
+Observe how variables included in strings are handled:
+
+::
+
+    => setenv var X; echo "a)" ${var} 'b)' '${var}' c) ${var}
+    a) X b) ${var} c) X
+    =>
+
+
+-n suppresses the line feed:
+
+::
+
+    => echo -n 1 2 3; echo a b c
+    1 2 3a b c
+    => echo -n 1 2 3
+    1 2 3=>
+
+A more complex example:
+
+::
+
+    => for i in a b c; do for j in 1 2 3; do echo -n "${i}${j}, "; done; echo; done;
+    a1, a2, a3,
+    b1, b2, b3,
+    c1, c2, c3,
+    =>
+
+Return value
+------------
+
+The return value $? is always set to 0 (true).
diff --git a/doc/usage/index.rst b/doc/usage/index.rst
index 6f49652758..317db3b449 100644
--- a/doc/usage/index.rst
+++ b/doc/usage/index.rst
@@ -17,6 +17,7 @@ Shell commands
    bootefi
    bootmenu
    button
+   echo
    exit
    for
    mbr
--
2.29.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 1/1] doc: document echo command
  2021-01-21 17:55 [PATCH 1/1] doc: document echo command Heinrich Schuchardt
@ 2021-01-24  2:03 ` Simon Glass
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Glass @ 2021-01-24  2:03 UTC (permalink / raw)
  To: u-boot

On Thu, 21 Jan 2021 at 10:55, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> Provide a man-page for the echo command.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  doc/usage/echo.rst  | 65 +++++++++++++++++++++++++++++++++++++++++++++
>  doc/usage/index.rst |  1 +
>  2 files changed, 66 insertions(+)
>  create mode 100644 doc/usage/echo.rst
>
Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-24  2:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-21 17:55 [PATCH 1/1] doc: document echo command Heinrich Schuchardt
2021-01-24  2:03 ` Simon Glass

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.