Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

print - write arguments to standard output

&pagelevel(4)&pagelevel

print is the output mechanism of the POSIX shell.


Syntax

print[ -Rnprs][ -ufiledes]][ arg]...

If it is invoked with no options or with the optionor --, the arguments are printed on standard output as explained in the echo command description.

-R or -r

In raw mode, the escape conventions of echo are ignored. The -R option prints all
subsequent arguments and options except for the -n option.

-n

No newline is added to the output.

-p

The arguments are written to the pipe of the process spawned with |&, not to standard output.

-s

The arguments are written to the history file, not to standard output.

-ufiledes

Arguments are written to the single-digit file descriptor filedes, not to standard output.

argument

see echo

Example 1

Various output possibilities for the string abcdef.

$ print "abc\tdef"
abc     def
$ print -r "abc\tdef"
abc\tdef
$ print -R "abc\tdef"
abc\tdef
$ print -n abc; print def
abcdef

Example 2

Output to a file via the file descriptor.

$ exec 4>print.out
$ prinf -u4 abc
$ cat print.out
abc

For further examples, see echo.

See also

echo, read