echo

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package echo implements the echo builtin command.

echo — write arguments to standard output

Usage: echo [-neE] [ARG]...

Write each ARG to standard output, separated by a single space, followed by a newline.

Flags (bash-compatible, not POSIX getopt):

-n  Do not output a trailing newline.
-e  Enable interpretation of backslash escape sequences.
-E  Disable interpretation of backslash escapes (default).

Flags can be combined (e.g. -ne). Only leading arguments matching -[neE]+ are treated as flags; once a non-flag argument is seen, all remaining arguments (including it) are printed as text. "--" is NOT treated as an end-of-options separator.

Supported escape sequences (with -e):

\\    backslash
\a    alert (BEL)
\b    backspace
\c    suppress further output (including trailing newline)
\e    escape character (0x1B)
\E    escape character (0x1B)
\f    form feed
\n    newline
\r    carriage return
\t    horizontal tab
\v    vertical tab
\0nnn octal value (1 to 3 digits)
\xHH  hexadecimal value (1 to 2 digits)
\uHHHH    Unicode character (1 to 4 hex digits)
\UHHHHHHHH Unicode character (1 to 8 hex digits)

Exit codes:

0  Always succeeds.

Index

Constants

This section is empty.

Variables

View Source
var Cmd = builtins.Command{Name: "echo", Description: "write arguments to stdout", MakeFlags: builtins.NoFlags(run)}

Cmd is the echo builtin command descriptor.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL