xref: /openbsd-src/bin/echo/echo.1 (revision 519cd48eb264cb116003e990c67a26e3eee23800)
1*519cd48eSschwarze.\"	$OpenBSD: echo.1,v 1.24 2018/03/16 16:58:26 schwarze Exp $
2df930be7Sderaadt.\"	$NetBSD: echo.1,v 1.7 1995/03/21 09:04:26 cgd Exp $
3df930be7Sderaadt.\"
4df930be7Sderaadt.\" Copyright (c) 1990, 1993
5df930be7Sderaadt.\"	The Regents of the University of California.  All rights reserved.
6df930be7Sderaadt.\"
7df930be7Sderaadt.\" This code is derived from software contributed to Berkeley by
8df930be7Sderaadt.\" the Institute of Electrical and Electronics Engineers, Inc.
9df930be7Sderaadt.\"
10df930be7Sderaadt.\" Redistribution and use in source and binary forms, with or without
11df930be7Sderaadt.\" modification, are permitted provided that the following conditions
12df930be7Sderaadt.\" are met:
13df930be7Sderaadt.\" 1. Redistributions of source code must retain the above copyright
14df930be7Sderaadt.\"    notice, this list of conditions and the following disclaimer.
15df930be7Sderaadt.\" 2. Redistributions in binary form must reproduce the above copyright
16df930be7Sderaadt.\"    notice, this list of conditions and the following disclaimer in the
17df930be7Sderaadt.\"    documentation and/or other materials provided with the distribution.
1829295d1cSmillert.\" 3. Neither the name of the University nor the names of its contributors
19df930be7Sderaadt.\"    may be used to endorse or promote products derived from this software
20df930be7Sderaadt.\"    without specific prior written permission.
21df930be7Sderaadt.\"
22df930be7Sderaadt.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23df930be7Sderaadt.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24df930be7Sderaadt.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25df930be7Sderaadt.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26df930be7Sderaadt.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27df930be7Sderaadt.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28df930be7Sderaadt.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29df930be7Sderaadt.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30df930be7Sderaadt.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31df930be7Sderaadt.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32df930be7Sderaadt.\" SUCH DAMAGE.
33df930be7Sderaadt.\"
34df930be7Sderaadt.\"	@(#)echo.1	8.1 (Berkeley) 7/22/93
35df930be7Sderaadt.\"
36*519cd48eSschwarze.Dd $Mdocdate: March 16 2018 $
37df930be7Sderaadt.Dt ECHO 1
38df930be7Sderaadt.Os
39df930be7Sderaadt.Sh NAME
40df930be7Sderaadt.Nm echo
41df930be7Sderaadt.Nd write arguments to the standard output
42df930be7Sderaadt.Sh SYNOPSIS
437349792aSaaron.Nm echo
44df930be7Sderaadt.Op Fl n
45f81d96dfSaaron.Op Ar string ...
46df930be7Sderaadt.Sh DESCRIPTION
47df930be7SderaadtThe
48f11c8a18Saaron.Nm
49b3119326Saaronutility writes any specified operands, separated by single blank
507d978c5eSjmc.Pq Sq \ \&
51b3119326Saaroncharacters and followed by a newline
52b3119326Saaron.Pq Sq \en
53b3119326Saaroncharacter, to the standard
54df930be7Sderaadtoutput.
5544c17405Sjmc.Pp
56666cd011SaaronWhen no operands are given, only the newline is written.
57*519cd48eSschwarzeThe
58*519cd48eSschwarze.Fl \-
59*519cd48eSschwarzeoperand,
6044c17405Sjmcwhich generally denotes an end to option processing,
6144c17405Sjmcis treated as part of
6244c17405Sjmc.Ar string .
63df930be7Sderaadt.Pp
6418611b21SaaronThe options are as follows:
65f1ba3473Saaron.Bl -tag -width Ds
66df930be7Sderaadt.It Fl n
67df930be7SderaadtDo not print the trailing newline character.
68df930be7Sderaadt.El
6959a5f2b9Sjmc.Sh EXIT STATUS
7049378797Ssobrado.Ex -std echo
71df930be7Sderaadt.Sh SEE ALSO
72ab7e6c46Sjmc.Xr csh 1 ,
73ab7e6c46Sjmc.Xr ksh 1 ,
74df930be7Sderaadt.Xr printf 1
75df930be7Sderaadt.Sh STANDARDS
76df930be7SderaadtThe
77f11c8a18Saaron.Nm
780f3f4dbcSjmcutility is compliant with the
7999332e38Sjmc.St -p1003.1-2008
800f3f4dbcSjmcspecification.
810f3f4dbcSjmc.Pp
820f3f4dbcSjmcThe flag
830f3f4dbcSjmc.Op Fl n
84e2abca71Sjmcconflicts with the behaviour mandated by the
8544c17405SjmcX/Open System Interfaces option of the
8644c17405Sjmc.St -p1003.1-2008
87e2abca71Sjmcspecification,
88e2abca71Sjmcwhich says it should be treated as part of
89e2abca71Sjmc.Ar string .
90e2abca71SjmcAdditionally,
91e2abca71Sjmc.Nm
92e2abca71Sjmcdoes not support any of the backslash character sequences mandated by XSI.
9344c17405Sjmc.Pp
94d406b0bbSjmc.Nm
95d406b0bbSjmcalso exists as a built-in to
96d406b0bbSjmc.Xr csh 1
97d406b0bbSjmcand
98d406b0bbSjmc.Xr ksh 1 ,
99d406b0bbSjmcthough with a different syntax.
10044c17405Sjmc.Pp
10144c17405SjmcWhere portability is paramount, use
10244c17405Sjmc.Xr printf 1 .
103b35d111eSschwarze.Sh HISTORY
104b35d111eSschwarzeAn
105b35d111eSschwarze.Nm
106b35d111eSschwarzeutility appeared in
107b35d111eSschwarze.At v2 .
108