aboutsummaryrefslogtreecommitdiff
path: root/bin/echo/echo.1
diff options
context:
space:
mode:
authorJilles Tjoelker <jilles@FreeBSD.org>2010-11-21 17:14:22 +0000
committerJilles Tjoelker <jilles@FreeBSD.org>2010-11-21 17:14:22 +0000
commit9cbdf40ca3ec9b7df306ba2a5aab06ef192a9add (patch)
tree7d90ed3e7fa7661165fbfb4b813f13da53cbe4cc /bin/echo/echo.1
parent9360e116c9bb8a2a675e15a5912c9c297f51e095 (diff)
downloadsrc-9cbdf40ca3ec9b7df306ba2a5aab06ef192a9add.tar.gz
src-9cbdf40ca3ec9b7df306ba2a5aab06ef192a9add.zip
MFC r215211: echo(1): Clarify portability and mention literal "--" handling.
Notes
Notes: svn path=/stable/7/; revision=215639
Diffstat (limited to 'bin/echo/echo.1')
-rw-r--r--bin/echo/echo.131
1 files changed, 22 insertions, 9 deletions
diff --git a/bin/echo/echo.1 b/bin/echo/echo.1
index 5f7123e9c28a..f1f3907233f5 100644
--- a/bin/echo/echo.1
+++ b/bin/echo/echo.1
@@ -32,7 +32,7 @@
.\" @(#)echo.1 8.1 (Berkeley) 7/22/93
.\" $FreeBSD$
.\"
-.Dd April 12, 2003
+.Dd November 12, 2010
.Dt ECHO 1
.Os
.Sh NAME
@@ -56,24 +56,37 @@ The following option is available:
.Bl -tag -width flag
.It Fl n
Do not print the trailing newline character.
-This may also be achieved by appending
+.El
+.Pp
+The end-of-options marker
+.Fl Fl
+is not recognized and written literally.
+.Pp
+The newline may also be suppressed by appending
.Ql \ec
to the end of the string, as is done
by iBCS2 compatible systems.
-Note that this option as well as the effect of
+Note that the
+.Fl n
+option as well as the effect of
.Ql \ec
are implementation-defined in
.St -p1003.1-2001
as amended by Cor.\& 1-2002.
-Applications aiming for maximum
-portability are strongly encouraged to use
+For portability,
+.Nm
+should only be used if the first argument does not start with a hyphen
+.Pq Ql "-"
+and does not contain any backslashes
+.Pq Ql "\e" .
+If this is not sufficient,
.Xr printf 1
-to suppress the newline character.
-.El
+should be used.
.Pp
-Some shells may provide a builtin
+Most shells provide a builtin
.Nm
-command which is similar or identical to this utility.
+command which tends to differ from this utility
+in the treatment of options and backslashes.
Consult the
.Xr builtin 1
manual page.