- 帖子
- 1023
- 积分
- 3120
- 技术
- 230
- 捐助
- 160
- 注册时间
- 2010-12-22
|
Usage:
printf.exe [Options]
printf.exe FORMAT [ARGUMENT] ...
Print ARGUMENT(s) according to FORMAT.
FORMAT controls the output as in C printf. Interpreted sequences are:
\OOO character with octal value OOO
\xHH character with hex value 0xHH
\uHHHH Unicode character with hex value 0xHHHH
\\ backslash
\a audible BEL
\b backspace
\f form feed
\n new line
\r return
\t horizontal tab
\v vertical tab
\PQOALGUISE (%"'&<>^| =)
%% a single %
%b ARGUMENT as a string with '\' escapes interpreted
and all C format specifications ending with one of diouxXfeEgGcs,
with ARGUMENTs converted to proper type first. Variable widths are handled.
Positional parameters (%n$... *m$) are handled too.
If there are more string operands than format specifiers, the format string is
reused from the beginning. If there are fewer string operands than format specif
iers,
then string specifiers are treated as if empty strings were supplied,
numeric conversions are treated as if 0 was supplied.
Options:
--help display this help and exit
--version output version information and exit
--cp=CodePage set output code page
Examples:
printf "%5d%4d\n" 1 21 321 4321 54321
printf "%s, %s %d, %d:%.2d\n" %weekday% %month% %day% %hour% %min%
printf "%1$s, %3$d. %2$s, %4$d:%5$.2d\n" monday october 4 17 41
printf "%1$s :: %1$f :: %1$'f :: %1$,f" 1234567.123456789
示例:
C:\>printf \u547d\u4ee4\u884c
命令行
注:
- UnxUtils 中 printf.exe 不支持转换 \uHHHH;
- coreutils 中的 printf.exe 可以转换 \uHHHH,但是需要依赖 libiconv2.dll libintl3.dll。
-------------------------------
官网: http://code.google.com/p/mini-gnu/
-------------------------------
http://bcn.bathome.net/s/tool/index.html?key=printf |
-
1
评分人数
-
|