1print(1) User Commands print(1)
2
3
4
6 print - shell built-in function to output characters to the screen or
7 window
8
10 ksh
11 print [-Rnprsu [n]] [arg]...
12
13
14 ksh93
15 print [-Renprs] [-f format] [-u fd] [string...]
16
17
19 ksh
20 The shell output mechanism. When no options are specified, or when an
21 option followed by ' a − is specified, or when just - is specified, the
22 arguments are printed on standard output as described by echo(1).
23
24 ksh93
25 By default, print writes each string operand to standard output and
26 appends a NEWLINE character.
27
28
29 Unless, the -r, -R, or -f option is speciifed, each \ character in each
30 string operand is processed specially as follows:
31
32 \a Alert character.
33
34
35 \b Backspace character.
36
37
38 \c Terminate output without appending NEWLINE. The remaining
39 string operands are ignored.
40
41
42 \E Escape character (ASCII octal 033).
43
44
45 \f FORM FEED character.
46
47
48 \n NEWLINE character.
49
50
51 \t Tab character.
52
53
54 \v Vertical tab character.
55
56
57 \\ Backslash character.
58
59
60 \0x The 8-bit character whose ASCII code is the 1-, 2-, or 3-digit
61 octal number x.
62
63
65 ksh
66 The following options are supported by ksh:
67
68 -n Suppresses new-line from being added to the output.
69
70
71 -r-R Raw mode. Ignore the escape conventions of echo. The -R
72 option prints all subsequent arguments and options other
73 than -n.
74
75
76 -p Cause the arguments to be written onto the pipe of the
77 process spawned with |& instead of standard output.
78
79
80 -s Cause the arguments to be written onto the history file
81 instead of standard output.
82
83
84 -u [ n ] Specify a one digit file descriptor unit number n on which
85 the output is placed. The default is 1.
86
87
88 ksh93
89 The following options are supported by ksh93:
90
91 -e Unless -f is specified, process \ sequences in each string
92 operand as described above. This is the default behavior.
93
94 If both -e and -r are specified, the last one specified is
95 the one that is used.
96
97
98 -f format Write the string arguments using the format string format
99 and do not append a NEWLINE. See printf(1) for details on
100 how to specify format.
101
102 When the -f option is specified and there are more string
103 operands than format specifiers, the format string is
104 reprocessed from the beginning. If there are fewer string
105 operands than format specifiers, then outputting ends at
106 the first unneeded format specifier.
107
108
109 -n Do not append a NEWLINE character to the output.
110
111
112 -p Write to the current co-process instead of standard out‐
113 put.
114
115
116 -r Do not process \ sequences in each string operand as
117 -R described above.
118
119 If both -e and -r are specified, the last one specified is
120 the one that is used.
121
122
123 -s Write the output as an entry in the shell history file
124 instead of standard output.
125
126
127 -u fd Write to file descriptor number fd instead of standard
128 output. The default value is 1.
129
130
132 The following exit values are returned:
133
134 0 Successful completion.
135
136
137 >0 Output file is not open for writing.
138
139
141 See attributes(5) for descriptions of the following attributes:
142
143
144
145
146 ┌─────────────────────────────┬─────────────────────────────┐
147 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
148 ├─────────────────────────────┼─────────────────────────────┤
149 │Availability │SUNWcsu │
150 └─────────────────────────────┴─────────────────────────────┘
151
153 echo(1), ksh(1), ksh93(1), printf(1), attributes(5)
154
155
156
157SunOS 5.11 27 Mar 2008 print(1)