1 .\" $NetBSD: echo.1,v 1.13 2003/08/07 09:05:40 agc Exp $
3 .\" Copyright (c) 1991, 1993
4 .\" The Regents of the University of California. All rights reserved.
6 .\" This code is derived from software contributed to Berkeley by
8 .\" Copyright 1989 by Kenneth Almquist
10 .\" Redistribution and use in source and binary forms, with or without
11 .\" modification, are permitted provided that the following conditions
13 .\" 1. Redistributions of source code must retain the above copyright
14 .\" notice, this list of conditions and the following disclaimer.
15 .\" 2. Redistributions in binary form must reproduce the above copyright
16 .\" notice, this list of conditions and the following disclaimer in the
17 .\" documentation and/or other materials provided with the distribution.
18 .\" 3. Neither the name of the University nor the names of its contributors
19 .\" may be used to endorse or promote products derived from this software
20 .\" without specific prior written permission.
22 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 .\" @(#)echo.1 8.1 (Berkeley) 5/31/93
41 .Nd produce message in a shell script
48 prints its arguments on the standard output, separated by spaces.
51 option is present, a newline is output following the arguments.
56 to treat the escape sequences specially, as described in the following
60 option is the default, and is provided solely for compatibility with
62 Only one of the options
68 If any of the following sequences of characters is encountered during
69 output, the sequence is not output. Instead, the specified action is
71 .Bl -tag -width indent
73 A backspace character is output.
75 Subsequent output is suppressed. This is normally used at the end of the
76 last argument to suppress the trailing newline that
78 would otherwise output.
82 Output a newline character.
84 Output a carriage return.
86 Output a (horizontal) tab character.
88 Output a vertical tab.
89 .It Li \e0 Ns Ar digits
90 Output the character whose value is given by zero to three digits.
91 If there are zero digits, a nul character is output.
96 Remember that backslash is special to the shell and needs to be escaped.
97 To output a message to standard error, say
99 .D1 echo message \*[Gt]\*[Am]2
101 The octal character escape mechanism
102 .Pq Li \e0 Ns Ar digits
104 C language mechanism.
106 There is no way to force
108 to treat its arguments literally, rather than interpreting them as
109 options and escape sequences.