print — Return arguments from the shell


print [–npRrs] [–u[descriptor]] [argument …]


Calling print without options or with only the option displays each argument to the standard output using the same escape conventions as echo. In this case, print and echo work the same way; see echo.


The options accepted by print increase its utility beyond that of echo.
Does not automatically add a new line to the end of the output.
Sends output to a coprocess.
Is similar to –r, except that print treats all subsequent options (except –n) as arguments rather than as options.
Ignores escape conventions.
Appends the output to the command history file rather than sending it to standard output.
Redirects the output to the file corresponding to the single digit file descriptor. The default file descriptor is 1.

Usage notes

print is a built-in shell command.


print uses the following localization environment variables:
  • LANG
  • LC_ALL

See Localization for more information.

Exit values

Successful completion
Failure due to any of the following:
  • Incorrect descriptor specified with –u
  • Nonexistent coprocess
Failure due to an incorrect command-line option


Possible error messages include:
Cannot print on file descriptor …
You tried to print on a file descriptor that was not opened for writing.
History not available
You specified the –s option to write into a history file, but you are not now using a history file.


print is an extension to POSIX.2 and XPG.

Related information

echo, fc, read, sh