名称

printf - 格式化并显示数据

概述

printf 格式[参数列表]...
printf 选项

描述

按照指定格式打印参数列表中的参数或按照选项执行:

--help
显示此帮助信息并退出
--version
显示版本信息并退出

格式以 C printf 的方式控制输出。转义序列如下:

\"
双引号
\\
反斜线
\a
报警符(BEL)
\b
退格符
\c
禁止尾随的换行符
\e
escape 字符
\f
换页符
\n
另起一行
\r
回到行首
\t
水平制表符
\v
垂直制表符
\NNN
字节数以八进制数 NNN (1至3位)表示
\xHH
字节数以十六进制数 HH (1至2位)表示
\uHHHH
Unicode (ISO/IEC 10646) 字符,是 16进制值 HHHH(4位)
\UHHHHHHHH
Unicode 字符,是 16进制值 HHHHHHHH(8位)
%%
单个 %
%b
ARGUMENT as a string with '\' escapes interpreted, except that octal escapes are of the form \0 or \0NNN

and all C format specifications ending with one of diouxXfeEgGcs, with ARGUMENTs converted to proper type first. Variable widths are handled.

注意:您的 shell 可能内置了自己的 printf 程序版本,它通常会覆盖这里所提及的相应版本。请查阅您的 shell 文档获知它所支持的选项。

作者

由 David MacKenzie 编写。

报告错误

GNU coreutils 的在线帮助: <http://www.gnu.org/software/coreutils/>
请向 <http://translationproject.org/team/zh_CN.html> 报告 printf 的翻译错误。

版权

Copyright © 2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

参见

printf(3)


完整文档请见: <http://www.gnu.org/software/coreutils/printf>
或者在本地使用: info aq(coreutils) printf invocationaq


This document was created by man2html, using the manual pages.
Time: 14:42:02 GMT, August 11, 2015