Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/utilities/e/echo.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/utilities/e/echo.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/utilities/e/echo.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/utilities/e/echo.html on line 8

echo

Write arguments to standard output (POSIX)

Syntax:

echo [-n] [string...]

Runs on:

QNX Neutrino, Linux, Microsoft Windows

Options:

-n
Don't write a trailing newline character.
string
A string to be written to standard output.

Description:

The echo command is present both as a shell builtin (see the echo command for ksh) and as a standalone executable that can operate without the availability of the system shell. Both versions behave in a similar manner. To make sure you use the executable, specify the full path.

The echo utility writes its arguments, followed by a newline character, to standard output. If there are no arguments, only the newline character is written.

The echo utility supports the following escape sequences within string:

Escape Description
\a Write an alert character (the bell).
\b Write a backspace character.
\c Suppress the newline character that otherwise follows the final argument in the output. All characters following the \c in the arguments are ignored.
\f Write a formfeed character.
\n Write a newline character.
\r Write a carriage-return character.
\t Write a tab character.
\v Write a vertical tab character.
\\ Write a backslash character.
\0num Write an 8-bit value that's the ASCII character represented by the specified 1-, 2-, or 3-digit octal number num.

Note: The escape sequences listed above are extensions to POSIX. For a more versatile utility that's portable, see printf.

Examples:

Echo the string Hello, Mother\nHello, Father to the standard output (note that echo appends a final trailing newline):

$ echo 'Hello, Mother\nHello, Father'
Hello, Mother
Hello, Father
$

Exit status:

0
Successful completion.
>0
An error occurred.

See also:

cat, ksh, printf, sh


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/utilities/e/echo.html on line 232

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/utilities/e/echo.html on line 232