aboutsummaryrefslogtreecommitdiff
path: root/bin/echo
diff options
context:
space:
mode:
Diffstat (limited to 'bin/echo')
-rw-r--r--bin/echo/Makefile3
-rw-r--r--bin/echo/Makefile.depend3
-rw-r--r--bin/echo/echo.132
-rw-r--r--bin/echo/echo.c14
-rw-r--r--bin/echo/tests/Makefile2
-rw-r--r--bin/echo/tests/Makefile.depend1
-rw-r--r--bin/echo/tests/echo_test.sh1
7 files changed, 30 insertions, 26 deletions
diff --git a/bin/echo/Makefile b/bin/echo/Makefile
index bd4455395ac4..e730e0a44a63 100644
--- a/bin/echo/Makefile
+++ b/bin/echo/Makefile
@@ -1,6 +1,3 @@
-# @(#)Makefile 8.1 (Berkeley) 5/31/93
-# $FreeBSD$
-
.include <src.opts.mk>
PACKAGE=runtime
diff --git a/bin/echo/Makefile.depend b/bin/echo/Makefile.depend
index 1adfc08a54d6..38d979787478 100644
--- a/bin/echo/Makefile.depend
+++ b/bin/echo/Makefile.depend
@@ -1,13 +1,12 @@
-# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
- gnu/lib/csu \
include \
include/xlocale \
lib/${CSU_DIR} \
lib/libc \
lib/libcapsicum \
+ lib/libcasper/libcasper \
lib/libcompiler_rt \
diff --git a/bin/echo/echo.1 b/bin/echo/echo.1
index ea8957c15c5a..cb60bdcc88dd 100644
--- a/bin/echo/echo.1
+++ b/bin/echo/echo.1
@@ -29,9 +29,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" @(#)echo.1 8.1 (Berkeley) 7/22/93
-.\" $FreeBSD$
-.\"
.Dd October 5, 2016
.Dt ECHO 1
.Os
@@ -92,6 +89,24 @@ Consult the
manual page.
.Sh EXIT STATUS
.Ex -std
+.Sh EXAMPLES
+Special treatment of options and backslashes:
+.Bd -literal -offset indent
+$ /bin/echo "-hello\\tworld"
+-hello\tworld
+.Ed
+.Pp
+Avoid new line character:
+.Bd -literal -offset indent
+$ /bin/echo -n hello;/bin/echo world
+helloworld
+.Ed
+.Pp
+Or to achieve the same result:
+.Bd -literal -offset indent
+$ /bin/echo "hello\\c";/bin/echo world
+helloworld
+.Ed
.Sh SEE ALSO
.Xr builtin 1 ,
.Xr csh 1 ,
@@ -108,3 +123,14 @@ The
.Nm
command appeared in
.At v2 .
+.Sh CAVEATS
+The
+.Nm
+command behaves differently with regards to the built-in
+.Nm
+shell command in a number of ways including escaped characters handling.
+It also differs in behavior between different systems hence complicating writing
+portable scripts.
+It is advised to use the
+.Xr printf 1
+command to avoid these shortcomings.
diff --git a/bin/echo/echo.c b/bin/echo/echo.c
index 46796ad1a27d..b8f7507c416e 100644
--- a/bin/echo/echo.c
+++ b/bin/echo/echo.c
@@ -29,20 +29,6 @@
* SUCH DAMAGE.
*/
-#if 0
-#ifndef lint
-static char const copyright[] =
-"@(#) Copyright (c) 1989, 1993\n\
- The Regents of the University of California. All rights reserved.\n";
-#endif /* not lint */
-
-#ifndef lint
-static char sccsid[] = "@(#)echo.c 8.1 (Berkeley) 5/31/93";
-#endif /* not lint */
-#endif
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include <sys/types.h>
#include <sys/uio.h>
diff --git a/bin/echo/tests/Makefile b/bin/echo/tests/Makefile
index 5957ecbc1fa1..18fa46816770 100644
--- a/bin/echo/tests/Makefile
+++ b/bin/echo/tests/Makefile
@@ -1,5 +1,3 @@
-# $FreeBSD$
-
ATF_TESTS_SH+= echo_test
.include <bsd.test.mk>
diff --git a/bin/echo/tests/Makefile.depend b/bin/echo/tests/Makefile.depend
index f80275d86ab1..11aba52f82cf 100644
--- a/bin/echo/tests/Makefile.depend
+++ b/bin/echo/tests/Makefile.depend
@@ -1,4 +1,3 @@
-# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
diff --git a/bin/echo/tests/echo_test.sh b/bin/echo/tests/echo_test.sh
index 5c5fc1f92d8b..ab18f11d685e 100644
--- a/bin/echo/tests/echo_test.sh
+++ b/bin/echo/tests/echo_test.sh
@@ -23,7 +23,6 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# $FreeBSD$
#
atf_test_case n_output