怀孕前3个月需要注意什么| 八方来财是什么意思| 走路快的人是什么性格| 恋爱脑什么意思| 3.2号是什么星座| 反复是什么意思| 心电图逆钟向转位是什么意思| 被蛇咬了挂什么科| 梦见自己打胎是什么意思| 用什么泡脚减肥最快| 法官是干什么的| 海棠花什么时候开| 心脏早搏吃什么药效果好| 咳嗽不停是什么原因| 鲭鱼是什么鱼| 八字加一笔是什么字| 十二月二十七是什么星座| 痔疮术后吃什么恢复快| 825是什么意思| 虾和什么不能一起吃| 肝脾不和吃什么中成药| 迁移宫代表什么| 7月1日什么星座| 豆腐鱼是什么鱼| 南非用什么货币| 7.17是什么日子| 肋骨突出是什么原因| 斯什么意思| 本来无一物何处惹尘埃什么意思| 锴字五行属什么| 举案齐眉什么意思| 天台是什么意思| 尿路结石吃什么药| 副县长是什么级别干部| 肺气虚吃什么食物| 司马迁属什么生肖| 男性阴囊瘙痒是什么病| 早上起来腰疼是什么原因| 90年属什么| 脾胃寒湿吃什么中成药| 六度万行 是什么意思| rush是什么意思| 柠檬泡水喝有什么好处| 1月11是什么星座| 蜱虫咬人后有什么症状图片| 坚强后盾是什么意思| 血小板数目偏高是什么意思| 境遇是什么意思| 刀枪不入是什么生肖| 德育是什么| 胆囊切除有什么危害| 江小白是什么酒| 咽炎吃什么药最好效果| 合拍是什么意思| 甲状腺结节吃什么水果好| 司局级是什么级别| 塑料五行属什么| 西瓜红是什么颜色| 肠炎吃什么药好| 腹部胀气是什么原因| 狗的胡须有什么用| 左眼跳是什么原因| 什么粉一沾就痒还看不出来| 小孩出汗多是什么原因造成的| 金融数学学什么| 血小板减少有什么危害| 抑郁症什么意思| 两个夫一个车是什么字| 阿拉蕾什么意思| 作壁上观是什么生肖| 和衣是什么意思| 多发性硬化是什么病| 45岁属什么的生肖| 松字五行属什么| 狗狗窝咳吃什么药最好| 烟头属于什么垃圾| 没意思是什么意思| 怦然心动什么意思| 二月开什么花| 9.30号是什么星座| 什么的山顶| ecco什么牌子| 四季春属于什么茶| 静息是什么意思| 什么叫矫正视力| 淋巴细胞高是什么原因| 滑肠是什么意思| 小舅子是什么关系| 左旋肉碱什么时候吃效果好| 条条框框是什么意思| 归宁是什么意思| 脾胃湿热喝什么茶| 阳盛阴衰是什么意思| 愚孝什么意思| 数字3五行属什么| 脑炎是什么病严重吗| 胃痛挂什么科| 人为什么会中暑| 咖啡soe是什么意思| 吃皮蛋有什么好处和坏处| 动次打次是什么意思| 7月17日是什么日子| lop胎位是什么意思| 入睡困难吃什么中成药| 阴蒂痛是什么原因| 什么是假性抑郁症| 职业年金有什么用| 11.11什么星座| 什么原因会怀上葡萄胎| 宫颈炎吃什么药好| 枫叶的花语是什么| 宰相肚里能撑船是什么意思| 憋尿有什么危害| 生活质量是什么意思| 感冒发烧挂什么科| 什么病误诊为帕金森| 痞块是什么意思| 苦海翻起爱恨是什么歌| instagram是什么软件| 腋臭看什么科| 身强力壮是什么生肖| 怀孕吃什么宝宝会白| 维生素b补什么| pending是什么意思啊| 喧宾夺主什么意思| 什么叫肾阴虚和肾阳虚| 紫外线过敏用什么药| 晚上睡觉咳嗽是什么原因| 清理鱼缸粪便用什么鱼| 中指戴戒指代表什么| 哺乳期上火了吃什么降火最快| 嗓子发炎吃什么水果| 三月有什么节日| 眼白发青是什么原因| 腹腔气体多是什么原因| 老人睡眠多是什么原因| 申遗是什么意思| 肚子胀气放屁吃什么药| 高湛为什么帮梅长苏| 7月6日什么星座| 籽骨是什么意思| hpv16阳性有什么症状| 停月经有什么症状| 耐力是什么意思| 小苏打有什么作用| 喝普洱茶有什么好处| b超挂什么科| 拼音b像什么| 兵役是什么意思| 什么心什么气| 2月11号是什么星座| 宝宝在肚子里打嗝是什么原因| espresso是什么咖啡| 喝太多水对身体有什么影响| 撸管是什么感觉| 胸透是查什么的| 壁虎的尾巴有什么用| 离婚证是什么颜色| 19岁属什么的生肖| 什么叫总胆固醇| 戴黄金对身体有什么好处| 字母圈是什么意思| 和风对什么| 细胞学说揭示了什么| 感觉抑郁了去医院挂什么科| 老实的动物是什么生肖| 电瓶车充不进电是什么原因| 扦脚是什么意思| 咖啡不能和什么一起吃| 头爱出汗是什么原因| times什么意思| 什么是伪娘| 后背痒是什么病的前兆| r的平方是什么意思| 什么动物吃草| 鼻咽炎是什么症状| 活字印刷术是什么时候发明的| 软下疳是什么症状| 高血糖能吃什么水果| 西芹炒什么好吃| 来月经前有褐色分泌物是什么原因| 万马奔腾是什么生肖| 湿气重用什么药| 瞳距是什么| 复查肺结节挂什么科| 免去职务是什么意思| 总爱睡觉是什么原因| eva鞋底是什么材质| 暖手宝里面是什么| 耳根子软是什么意思| d2聚体高是什么意思| 孕期吃什么水果好| 笨什么笨什么| 小脑是控制什么的| 脑梗不能吃什么东西| 985什么意思| 什么是关键词| 反复口腔溃疡是什么原因| 透亮是什么意思| 坤沙酒是什么意思| 王是什么生肖| 脚麻木是什么病的前兆| 黑色上衣搭配什么颜色裤子好看| 亚硝酸钠是什么东西| 牛肉不能和什么水果一起吃| sle是什么病的缩写| 肺心病是什么病| 咽喉炎吃什么药管用| 肾漏蛋白是什么病| 眉毛上方有痣代表什么| 女孩月经不规律是什么原因| 山的五行属什么| 蟑螂怕什么| 芹菜和什么菜搭配最好| yl是什么牌子| 食道不舒服挂什么科| 为什么不建议切除脂肪瘤| 二月七号是什么星座| 梦见很多苍蝇是什么意思| 吃什么食物排湿气| 白目是什么意思| 女人吃桃子有什么好处和坏处| 腰扭伤了挂什么科| 基友什么意思| 木堂念什么| 瘦肚子吃什么水果| 防晒衣的面料是什么| giada是什么牌子| 为什么会感染幽门螺旋杆菌| 山药补什么| 墨迹是什么意思| 梦到打死蛇是什么意思| 怀孕初期有什么表现| 你从什么时候不再爱我| 维生素c什么时候吃效果最好| 狗男和什么属相最配| 阴茎长水泡是什么原因| 男人割了皮包什么样子| 杨梅泡酒有什么功效| 烂嘴角是缺什么维生素| 脾虚湿热吃什么中成药| 口臭吃什么| 咽喉老有痰是什么原因| 头发一半白一半黑是什么原因| 甲状腺斑块是什么意思| 小腹胀是什么原因女性| 咀嚼食用是什么意思| ana谱是查什么病的| 面皮是什么做的| 竹节虫吃什么| 益生菌有什么作用| 什么使我快乐| 吃醋是什么意思| 斯德哥尔摩综合症是什么意思| 什么是溶血| 什么是讨好型人格| 公因数是什么意思| 托班是什么意思| 请产假需要什么材料| msgm是什么品牌| 男戴观音女戴佛是什么意思| mpa什么意思| 胃息肉是什么症状| 氟骨症是什么病| 百度
The Open Group Base Specifications Issue 8
IEEE Std 1003.1-2024
Copyright ? 2001-2024 The IEEE and The Open Group

5. File Format Notation

The STDIN, STDOUT, STDERR, INPUT FILES, and OUTPUT FILES sections of the utility descriptions use a syntax to describe the data organization within the files, when that organization is not otherwise obvious. The syntax is similar to that used by the System Interfaces volume of POSIX.1-2024 printf() function, as described in this chapter. When used in STDIN or INPUT FILES sections of the utility descriptions, this syntax describes the format that could have been used to write the text to be read, not a format that could be used by the System Interfaces volume of POSIX.1-2024 scanf() function to read the input file.

The description of an individual record is as follows:

"<format>", [<arg1>, <arg2>,..., <argn>]

The format is a character string that contains three types of objects defined below:

  1. Characters that are not "escape sequences" or "conversion specifications", as described below, shall be copied to the output.

  2. Escape Sequences represent non-graphic characters and the escape character (<backslash>).

  3. Conversion Specifications specify the output format of each argument; see below.

The following characters have the following special meaning in the format string:

''
(An empty character position.) Represents one or more <blank> characters from the portable character set.
Δ
Represents exactly one <space> character.

Escape Sequences and Associated Actions lists escape sequences and associated actions on display devices capable of the action.

Table: Escape Sequences and Associated Actions

Escape Sequence

Represents Character

Terminal Action

\\

<backslash>

Print the <backslash> character.

\a

<alert>

Attempt to alert the user through audible or visible notification.

\b

<backspace>

Move the printing position to one column before the current position, unless the current position is the start of a line.

\f

<form-feed>

Move the printing position to the initial printing position of the next logical page.

\n

<newline>

Move the printing position to the start of the next line.

\r

<carriage-return>

Move the printing position to the start of the current line.

\t

<tab>

Move the printing position to the next tab position on the current line. If there are no more tab positions remaining on the line, the behavior is undefined.

\v

<vertical-tab>

Move the printing position to the start of the next <vertical-tab> position. If there are no more <vertical-tab> positions left on the page, the behavior is undefined.


Each conversion specification is introduced by the <percent-sign> character ('%'). After the character '%', the following shall appear in sequence:

flags
Zero or more flags, in any order, that modify the meaning of the conversion specification.
field width
An optional string of decimal digits to specify a minimum field width. For an output field, if the converted value has fewer bytes than the field width, it shall be padded on the left (or right, if the left-adjustment flag ('-'), described below, has been given) to the field width.
precision
Gives the minimum number of digits to appear for the d, o, i, u, x, or X conversion specifiers (the field is padded with leading zeros), the number of digits to appear after the radix character for the e and f conversion specifiers, the maximum number of significant digits for the g conversion specifier; or the maximum number of bytes to be written from a string in the s conversion specifier. The precision shall take the form of a <period> ('.') followed by a decimal digit string; a null digit string is treated as zero.
conversion specifier characters

A conversion specifier character (see below) that indicates the type of conversion to be applied.

The flag characters and their meanings are:

-
The result of the conversion shall be left-justified within the field.
+
The result of a signed conversion shall always begin with a sign ('+' or '-').
<space>
If the first character of a signed conversion is not a sign, a <space> shall be prefixed to the result. This means that if the <space> and '+' flags both appear, the <space> flag shall be ignored.
#
The value shall be converted to an alternative form. For c, d, i, u, and s conversion specifiers, the behavior is undefined. For the o conversion specifier, it shall increase the precision to force the first digit of the result to be a zero. For x or X conversion specifiers, a non-zero result has 0x or 0X prefixed to it, respectively. For a, A, e, E, f, F, g, and G conversion specifiers, the result shall always contain a radix character, even if no digits follow the radix character. For g and G conversion specifiers, trailing zeros shall not be removed from the result as they usually are.
0
For a, A, d, e, E, f, F, g, G, i, o, u, x, and X conversion specifiers, leading zeros (following any indication of sign or base) shall be used to pad to the field width rather than performing space padding, except when converting an infinity or NaN. If the '0' and '-' flags both appear, the '0' flag shall be ignored. For d, i, o, u, x, and X conversion specifiers, if a precision is specified, the '0' flag shall be ignored. For other conversion specifiers, the behavior is undefined.

Each conversion specifier character shall result in fetching zero or more arguments. The results are undefined if there are insufficient arguments for the format. If the format is exhausted while arguments remain, the excess arguments shall be ignored.

The conversion specifiers and their meanings are:

a,A
The floating-point number argument representing a floating-point number shall be converted in the style "[-]0xh.hhhhd", where there is one hexadecimal digit (which shall be non-zero if the argument is a normalized floating-point number and is otherwise unspecified) before the decimal-point character and the number of hexadecimal digits after it is equal to the precision; if the precision is missing and FLT_RADIX is a power of 2, then the precision shall be sufficient for an exact representation of the value; if the precision is missing and FLT_RADIX is not a power of 2, then the precision shall be sufficient to distinguish different floating-point values in the internal representation used by the utility, except that trailing zeros may be omitted; if the precision is zero and the # flag is not specified, no decimal-point character shall appear. The letters "abcdef" shall be used for a conversion and the letters "ABCDEF" for A conversion. The A conversion specifier produces a number with X and P instead of x and p. The exponent shall always contain at least one digit, and only as many more digits as necessary to represent the decimal exponent of 2. If the value is zero, the exponent shall be zero. A floating-point number argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.
d,i,o,u,x,X
The integer argument shall be written as signed decimal (d or i), unsigned octal (o), unsigned decimal (u), or unsigned hexadecimal notation (x and X). The d and i specifiers shall convert to signed decimal in the style "[-]dddd". The x conversion specifier shall use the numbers and letters "0123456789abcdef" and the X conversion specifier shall use the numbers and letters "0123456789ABCDEF". The precision component of the argument shall specify the minimum number of digits to appear. If the value being converted can be represented in fewer digits than the specified minimum, it shall be expanded with leading zeros. The default precision shall be 1. The result of converting a zero value with a precision of 0 shall be no characters. If both the field width and precision are omitted, the implementation may precede, follow, or precede and follow numeric arguments of types d, i, and u with <blank> characters from the portable character set; arguments of type o (octal) may be preceded with leading zeros.
f,F
The floating-point number argument shall be written in decimal notation in the style [-]ddd.ddd, where the number of digits after the radix character (shown here as a decimal point) shall be equal to the precision specification. The LC_NUMERIC locale category shall determine the radix character to use in this format. If the precision is omitted from the argument, six digits shall be written after the radix character; if the precision is explicitly 0, no radix character shall appear.

A floating-point number argument representing an infinity shall be converted in one of the styles "[-]inf" or "[-]infinity"; which style is implementation-defined. A floating-point number argument representing a NaN shall be converted in one of the styles "[-]nan(n-char-sequence)" or "[-]nan"; which style, and the meaning of any n-char-sequence, is implementation-defined. The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.

e,E
The floating-point number argument shall be written in the style [-]d.ddde±dd (the symbol '±' indicates either a <plus-sign> or <hyphen-minus>), where there is one digit before the radix character (shown here as a decimal point) and the number of digits after it is equal to the precision. The LC_NUMERIC locale category shall determine the radix character to use in this format. When the precision is missing, six digits shall be written after the radix character; if the precision is 0, no radix character shall appear. The E conversion specifier shall produce a number with E instead of e introducing the exponent. The exponent shall always contain at least two digits. However, if the value to be written requires an exponent greater than two digits, additional exponent digits shall be written as necessary.

A floating-point number argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.

g,G
The floating-point number argument shall be written in style f or e (or in style F or E in the case of a G conversion specifier), with the precision specifying the number of significant digits. The style used depends on the value converted: style e (or E) shall be used only if the exponent resulting from the conversion is less than -4 or greater than or equal to the precision. Trailing zeros are removed from the result. A radix character shall appear only if it is followed by a digit.

A floating-point number argument representing an infinity or NaN shall be converted in the style of an f or F conversion specifier.

c
The single-byte character argument shall be written.
s
The argument shall be taken to be a string and bytes from the string shall be written until the end of the string or the number of bytes indicated by the precision specification of the argument is reached. If the precision is omitted from the argument, it shall be taken to be infinite, so all bytes up to the end of the string shall be written.
%
Write a '%' character; no argument shall be converted. Applications using the printf utility shall ensure that the complete conversion specification is %%.

In no case does a nonexistent or insufficient field width cause truncation of a field; if the result of a conversion is wider than the field width, the field is simply expanded to contain the conversion result. The term "field width" should not be confused with the term "precision" used in the description of %s.


The following sections are informative.
Examples

To represent the output of a program that prints a date and time in the form Sunday, July 3, 10:02, where weekday and month are strings:

"%s,Δ%sΔ%d,Δ%d:%.2d\n" <weekday>, <month>, <day>, <hour>, <min>

To show '?' written to 5 decimal places:

"piΔ=Δ%.5f\n",<value of ?>

To show an input file format consisting of five <colon>-separated fields:

"%s:%s:%s:%s:%s\n", <arg1>, <arg2>, <arg3>, <arg4>, <arg5>
End of informative text.

 

return to top of page

UNIX? is a registered Trademark of The Open Group.
POSIX? is a Trademark of The IEEE.
Copyright ? 2001-2024 The IEEE and The Open Group, All Rights Reserved
[ Main Index | XBD | XSH | XCU | XRAT ]

尿尿疼是什么原因 burberry是什么品牌 三七粉主要治什么病 公主切适合什么脸型 ugg是什么品牌
碳水化合物对人体有什么作用 翻来覆去是什么意思 补肾壮阳吃什么药好 照影是什么检查 葛根有什么作用
ins是什么 孕妇能吃什么水果 鲜黄花菜含有什么毒素 团购什么意思 鹿晗是什么星座
千焦是什么单位 明星每天都吃什么 cems是什么意思 林彪为什么要叛逃 皮肤经常痒是什么原因
pd是什么元素hcv9jop4ns2r.cn 仄言是什么意思clwhiglsz.com 藜芦是什么东西hcv9jop4ns7r.cn 血管痉挛吃什么药hcv9jop1ns6r.cn 臀位是什么意思hcv7jop6ns4r.cn
男性夜间盗汗是什么原因hcv9jop3ns4r.cn 红薯叶不能和什么一起吃hcv8jop8ns3r.cn 心脏神经官能症吃什么药hcv9jop2ns9r.cn 产品标准号是什么zsyouku.com 豆浆不能和什么一起吃hcv9jop6ns5r.cn
维u是什么药hcv7jop6ns5r.cn 传媒公司是做什么的0735v.com 月经推迟一个月不来什么原因xscnpatent.com 什么的秃鹫hcv8jop7ns8r.cn 缺铁性贫血吃什么水果hcv9jop7ns9r.cn
女人更年期有什么症状hcv9jop8ns1r.cn 梦见上香是什么意思hcv8jop4ns6r.cn 什么的阳光hcv8jop1ns7r.cn 青枝骨折属于什么骨折hcv7jop6ns9r.cn 冠心病什么症状表现hcv7jop5ns0r.cn
百度