108 lines
2.3 KiB
Groff
108 lines
2.3 KiB
Groff
'\"macro stdmacro
|
|
.if n .pH g1.echo @(#)echo 30.2 of 12/25/85
|
|
.nr X
|
|
.if \nX=0 .ds x} ECHO 1 "Essential Utilities" "\&"
|
|
.if \nX=1 .ds x} ECHO 1 "Essential Utilities"
|
|
.if \nX=2 .ds x} ECHO 1 "" "\&"
|
|
.if \nX=3 .ds x} ECHO "" "" "\&"
|
|
.TH \*(x}
|
|
.SH NAME
|
|
echo \- echo arguments
|
|
.SH SYNOPSIS
|
|
.B echo
|
|
[
|
|
.B -n
|
|
] [ arg ] ...
|
|
.SH DESCRIPTION
|
|
.I echo\^
|
|
writes its arguments separated by blanks and terminated by
|
|
a new-line (except when "-n" is specified, see below) on the standard output.
|
|
It also
|
|
understands C-like escape conventions;
|
|
beware of conflicts with the shell's use of \f3\e\fP:
|
|
.PP
|
|
.RS
|
|
.PD 0
|
|
.TP
|
|
.B \eb
|
|
backspace
|
|
.TP
|
|
.B \ec
|
|
print line without new-line
|
|
.TP
|
|
.B \ef
|
|
form-feed
|
|
.TP
|
|
.B \en
|
|
new-line
|
|
.TP
|
|
.B \er
|
|
carriage return
|
|
.TP
|
|
.B \et
|
|
tab
|
|
.TP
|
|
.B \ev
|
|
vertical tab
|
|
.TP
|
|
.B \e\e
|
|
backslash
|
|
.TP
|
|
.BI \e0 n\^
|
|
where
|
|
.I n\^
|
|
is the 8-bit character whose \s-1ASCII\s0 code is
|
|
the 1-, 2- or 3-digit octal number representing that character.
|
|
.RE
|
|
.PD
|
|
.PP
|
|
.I echo\^
|
|
has two operating modes. By default,
|
|
.I echo\^
|
|
operates compatibly with certain earlier versions of System V
|
|
.I echo\^.
|
|
If the environment variable
|
|
.B _XPG
|
|
is defined, and has a numeric
|
|
value greater than 0, sed operates in conformance with the
|
|
X/Open XPG4 specifications. In this mode, when
|
|
.B -n
|
|
is specified, it is treated as a string, like any other arguments.
|
|
In the backward compatibility mode,
|
|
when
|
|
.B -n
|
|
is specified, it means "no new-line". The arguments will not be
|
|
terminated by a new-line on the standard output.
|
|
.PP
|
|
.I echo\^
|
|
is useful for producing diagnostics in command files
|
|
and for sending known data into a pipe.
|
|
.SH SEE ALSO
|
|
csh(1), sh(1).
|
|
.SH CAVEATS
|
|
When representing an 8-bit character by using the escape convention
|
|
.BI \e0 n\^,
|
|
the
|
|
.I n\^
|
|
must
|
|
.B always
|
|
be preceded by the digit zero (0).
|
|
.sp .5
|
|
For example, typing:
|
|
.B "echo \'\s-1WARNING\s+1:\e07\'"
|
|
will print the phrase
|
|
.B "\s-1WARNING\s+1:"
|
|
and sound the ``bell'' on your terminal.
|
|
The use of single (or double) quotes
|
|
(or two backslashes) is required to protect the ``\e''
|
|
that precedes the ``07''.
|
|
.sp .5
|
|
For the octal equivalents of each character,
|
|
see
|
|
ascii\^(5).
|
|
.PP
|
|
echo is often a builtin to the shells, see the shell man pages
|
|
for feature specific to each shell. This man page documents
|
|
the executable program, not the builtin versions, although they
|
|
are similar.
|