diff options
| author | Bin Meng <bmeng.cn@gmail.com> | 2022-03-28 11:02:56 +0800 |
|---|---|---|
| committer | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2022-03-31 19:06:16 +0200 |
| commit | 34e452dd0252c162242a718ed5287a2af622b7d7 (patch) | |
| tree | a8a179f5b78f829947fdd67ec0f6b685dff46780 /doc/usage/cmd/echo.rst | |
| parent | 572934d15a67ce5643472b5f6d3151476cc2b89d (diff) | |
doc: usage: Group all shell command docs into cmd/ sub-directory
Currently all shell command docs are put in the doc/usage root.
Let's group them into cmd/ sub-directory.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'doc/usage/cmd/echo.rst')
| -rw-r--r-- | doc/usage/cmd/echo.rst | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/doc/usage/cmd/echo.rst b/doc/usage/cmd/echo.rst new file mode 100644 index 00000000000..861abdfd1eb --- /dev/null +++ b/doc/usage/cmd/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). |
