summaryrefslogtreecommitdiff
path: root/usr/src/man/man1/print.1
blob: d01c47e08799395ebe242d310d46f1490cc0d95a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
'\" te
.\" Copyright (c) 2008 Sun Microsystems, Inc. - All Rights Reserved.
.\" Copyright 1989 AT&T
.\" Portions Copyright (c) 1982-2007 AT&T Knowledge Ventures
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH PRINT 1 "December 28, 2020"
.SH NAME
print \- shell built-in function to output characters to the screen or window
.SH SYNOPSIS
.SS "ksh"
.nf
\fBprint\fR [\fB-Rnprsu\fR [\fIn\fR]] [\fIarg\fR]...
.fi

.SS "ksh93"
.nf
\fBprint\fR [\fB-Renprs\fR] [\fB-f\fR \fIformat\fR] [\fB-u\fR \fIfd\fR] [\fIstring\fR...]
.fi

.SH DESCRIPTION
.SS "ksh"
The shell output mechanism. When no options are specified, or when an option
followed by \fB\&'\fR a \fB\(mi\fR is specified, or when just \fB-\fR is
specified, the arguments are printed on standard output as described by
\fBecho\fR(1).
.SS "ksh93"
By default, \fBprint\fR writes each string operand to standard output and
appends a NEWLINE character.
.sp
.LP
Unless, the \fB-r\fR, \fB-R\fR, or \fB-f\fR option is specified, each \fB\e\fR
character in each string operand is processed specially as follows:
.sp
.ne 2
.na
\fB\fB\ea\fR\fR
.ad
.RS 8n
Alert character.
.RE

.sp
.ne 2
.na
\fB\fB\eb\fR\fR
.ad
.RS 8n
Backspace character.
.RE

.sp
.ne 2
.na
\fB\fB\ec\fR\fR
.ad
.RS 8n
Terminate output without appending NEWLINE. The remaining string operands are
ignored.
.RE

.sp
.ne 2
.na
\fB\fB\eE\fR\fR
.ad
.RS 8n
Escape character (\fBASCII\fR octal \fB033\fR).
.RE

.sp
.ne 2
.na
\fB\fB\ef\fR\fR
.ad
.RS 8n
FORM FEED character.
.RE

.sp
.ne 2
.na
\fB\fB\en\fR\fR
.ad
.RS 8n
NEWLINE character.
.RE

.sp
.ne 2
.na
\fB\fB\et\fR\fR
.ad
.RS 8n
Tab character.
.RE

.sp
.ne 2
.na
\fB\fB\ev\fR\fR
.ad
.RS 8n
Vertical tab character.
.RE

.sp
.ne 2
.na
\fB\fB\e\e\fR\fR
.ad
.RS 8n
Backslash character.
.RE

.sp
.ne 2
.na
\fB\fB\e0\fR\fIx\fR\fR
.ad
.RS 8n
The 8-bit character whose \fBASCII\fR code is the \fB1\fR-, \fB2\fR-, or
\fB3\fR-digit octal number \fIx\fR.
.RE

.SH OPTIONS
.SS "ksh"
The following options are supported by \fBksh\fR:
.sp
.ne 2
.na
\fB\fB-n\fR\fR
.ad
.RS 12n
Suppresses \fBnew-line\fR from being added to the output.
.RE

.sp
.ne 2
.na
\fB\fB-r\fR\fB-R\fR\fR
.ad
.RS 12n
Raw mode. Ignore the escape conventions of \fBecho\fR. The \fB-R\fR option
prints all subsequent arguments and options other than \fB-n\fR.
.RE

.sp
.ne 2
.na
\fB\fB-p\fR\fR
.ad
.RS 12n
Cause the arguments to be written onto the pipe of the process spawned with
\fB|&\fR instead of standard output.
.RE

.sp
.ne 2
.na
\fB\fB-s\fR\fR
.ad
.RS 12n
Cause the arguments to be written onto the history file instead of standard
output.
.RE

.sp
.ne 2
.na
\fB\fB-u\fR [ \fIn\fR ]\fR
.ad
.RS 12n
Specify a one digit file descriptor unit number \fIn\fR on which the output is
placed. The default is 1.
.RE

.SS "ksh93"
The following options are supported by \fBksh93\fR:
.sp
.ne 2
.na
\fB\fB-e\fR \fI\fR\fR
.ad
.RS 13n
Unless \fB-f\fR is specified, process \fB\e\fR sequences in each string operand
as described above. This is the default behavior.
.sp
If both \fB-e\fR and \fB-r\fR are specified, the last one specified is the one
that is used.
.RE

.sp
.ne 2
.na
\fB\fB-f\fR \fIformat\fR\fR
.ad
.RS 13n
Write the string arguments using the format string \fIformat\fR and do not
append a NEWLINE. See \fBprintf\fR(1) for details on how to specify format.
.sp
When the \fB-f\fR option is specified and there are more string operands than
format specifiers, the format string is reprocessed from the beginning. If
there are fewer string operands than format specifiers, then outputting ends at
the first unneeded format specifier.
.RE

.sp
.ne 2
.na
\fB\fB-n\fR\fR
.ad
.RS 13n
Do not append a NEWLINE character to the output.
.RE

.sp
.ne 2
.na
\fB\fB-p\fR\fR
.ad
.RS 13n
Write to the current co-process instead of standard output.
.RE

.sp
.ne 2
.na
\fB\fB-r\fR\fR
.ad
.br
.na
\fB\fB-R\fR\fR
.ad
.RS 13n
Do not process \fB\e\fR sequences in each string operand as described above.
.sp
If both \fB-e\fR and \fB-r\fR are specified, the last one specified is the one
that is used.
.RE

.sp
.ne 2
.na
\fB\fB-s\fR\fR
.ad
.RS 13n
Write the output as an entry in the shell history file instead of standard
output.
.RE

.sp
.ne 2
.na
\fB\fB-u\fR \fIfd\fR\fR
.ad
.RS 13n
Write to file descriptor number \fIfd\fR instead of standard output. The
default value is \fB1\fR.
.RE

.SH EXIT STATUS
The following exit values are returned:
.sp
.ne 2
.na
\fB\fB0\fR\fR
.ad
.RS 6n
Successful completion.
.RE

.sp
.ne 2
.na
\fB\fB>0\fR\fR
.ad
.RS 6n
Output file is not open for writing.
.RE

.SH SEE ALSO
.BR echo (1),
.BR ksh (1),
.BR ksh93 (1),
.BR printf (1),
.BR attributes (7)