蝴蝶有什么寓意| 为什么读研| 皮肤白斑是什么原因| dr拍片是检查什么的| 尿的酸碱度能说明什么| 哺乳期抽烟对宝宝有什么影响| 蓁字五行属什么| 阴历是什么| 刺梨有什么功效| 甲亢病有什么症状| 后背疼是什么原因引起的| 谷雨是什么意思| 口水臭什么原因| 谷草谷丙高是什么原因| 反酸是什么原因| 小孩尿不出来尿是什么原因| 吃糖醋蒜有什么好处和坏处| 胃糜烂有什么症状| 人体最大的消化腺是什么| 紫烟是什么意思| 贝壳是什么垃圾| 喝了藿香正气水不能吃什么| 汗疱疹是什么原因引起| 胆囊炎吃什么消炎药| 阴阳双补用什么药最佳| 1996年出生属什么| 晨起嘴苦是什么原因| 芭蕉和香蕉有什么区别| 知进退明得失什么意思| 结婚送什么| 脾虚吃什么中药| 摩羯座是什么星座| 胃热吃什么药最有效| 结梁子什么意思| 皮肤黑适合什么颜色的衣服| 石乐读什么| 刑事拘留意味着什么| 心脾两虚是什么意思| 瓜皮是什么意思| 生眼屎是什么原因引起的| 白色车里放什么摆件好| 老师家访的目的是什么| 小狗是什么意思| 复方阿胶浆适合什么样的人喝| 小孩出汗多是什么原因| trace是什么意思| 甲状腺吃什么食物好| 十点多是什么时辰| 吃什么药升血小板最快| 西梅什么时候成熟| 空挡是什么意思| nothomme什么牌子| 左下腹是什么器官| 黄芪长什么样| 大修基金什么时候缴纳| 6月6是什么节日| 消症是什么意思| 砼为什么念hun| 飘了是什么意思| mcm是什么牌子| 口腔溃疡是缺什么| 一般什么人会有美人尖| 5月4日是什么星座| 吃白萝卜有什么好处| model是什么品牌| 猎头是干什么的| 鼻子上长痘痘是什么原因| 拉绿色大便是什么原因| 寒门子弟是什么意思| 小腿酸胀痛是什么原因| 5月有什么节日| cas是什么| 什么时机塞给医生红包| 尿蛋白阳性是什么意思| 什么盐比较好| 公章一般是什么字体| 个性是什么意思| 哪吒长什么样子| essence什么意思| 为什么会突然头晕| 日本旅游买什么东西最划算| 七月份适合种什么蔬菜| 6月12是什么星座| 煦字五行属什么| 聪明是什么意思| 白洞是什么| 男女身份证号码有什么区分| 什么的腊梅| 吃芒果不能和什么一起吃| 碗摔碎了预示着什么| 尿道感染有什么症状| 如果怀孕了会有什么预兆| 眼睛干涩模糊用什么眼药水| 早上咳嗽是什么原因| 瑞夫泰格手表什么档次| 稽留流产什么意思| 炸油条用什么油最好| 龙虾吃什么食物| 海参什么样的好| 黄油是用什么做的| 肺结节影是什么意思啊| 马克杯是什么意思| 鱼油有什么好处| 减肥期间适合喝什么酒| 中国国鸟是什么| 5月6日是什么星座| 将军代表什么生肖| 爱思是什么| 伤风败俗是什么意思| 胃幽门螺旋杆菌吃什么药效果好| 上海新华医院擅长什么| 牛仔蓝是什么颜色| aj是什么牌子| 血压高有什么危害| 夜黑风高什么意思| 1月30日什么星座| 女人吃什么水果最好| 什么叫瑕疵| 经血逆流的症状是什么| 辛卯五行属什么| 高密度脂蛋白胆固醇偏高是什么意思| 细菌性肠炎吃什么药| 瘦肉精是什么| 结缔组织是什么| 招财猫鱼吃什么| 大排畸是什么检查| 汪小菲什么星座| 黄牌是什么意思| 什么时间段买机票最便宜| 什么梗| 兜底是什么意思| 粘纤是什么| 什么品种的西瓜最好吃| 什么的闪电| 什么原因导致性功能减退| 少校军衔是什么级别| 大便是红色的是什么原因| 熟络是什么意思| 感激不尽是什么意思| 滑膜炎是什么症状| 发炎是什么原因引起的| 女人长胡子是什么原因| 腹股沟淋巴结肿大挂什么科| 嗓子疼吃什么药最管用| 排卵期之后是什么期| 例假提前半个月是什么原因造成的| 护资成绩什么时候出| 老年人口干是什么原因| 34岁属什么| 忧郁什么意思| 狭鳕鱼是什么鱼| 蓝海是什么意思| 肚子胀气吃什么通气| 什么字属金| 金命是什么意思| 柠檬苦是什么原因| 血热吃什么药可以凉血| 头晕恶心吃什么药| 右边小腹疼是什么原因| 鱿鱼不能和什么一起吃| 老年人脚肿吃什么药| 凌波仙子是什么花| 脚气缺什么维生素| 爷俩是什么意思| 胆固醇是什么意思| 班禅是什么级别| 胃食管反流咳嗽吃什么药| 指导员是什么级别| 乳腺结节有什么症状| 什么茶降尿酸| 激素六项什么时间查最好| 地道战在河北什么地方| 甘油三酯高吃什么| 梦到买房子是什么意思| 羊与什么相冲| 布谷鸟叫有什么征兆| 什么的双手| 喝铁观音茶有什么好处| 皮肤黑适合什么颜色的衣服| 早上起来腰疼是什么原因| 蘑菇是什么菌| 胃大肚子大是什么原因| 乳酸杆菌大量是什么意思| 15度穿什么衣服合适| 坚果补充什么营养成分| 什么洗衣液是中性的| 西瓜虫吃什么食物| 宠物蛇吃什么| 吃什么解毒| 易烊千玺的真名叫什么| 醋酸视黄酯是什么| 流清鼻涕是什么感冒| 水蛭是什么动物| 怀孕两个月出血是什么原因| 1983年出生是什么命| 1996年属鼠五行属什么| 踩指压板有什么好处| 股骨长径是指胎儿什么| 为什么说黑鱼是鬼| 美国为什么要打伊拉克| 抽血挂什么科| 咖啡有什么好处| 杨公忌日是什么意思| 槟榔吃多了有什么危害| 正常白带什么样| 肾结石有什么症状哪里疼| 血红蛋白浓度偏高是什么原因| 什么病会引起背部疼痛| 克星是什么意思| 猫头鹰属于什么科| 29度穿什么衣服合适| 迫切是什么意思| 大臂疼痛怎么什么原因| 白羊座是什么星座| 病是什么结构的字| 茉莉花长什么样| 1936年属什么生肖| 什么牌子的洗衣机最好| 卖淫什么意思| 畸形是什么意思| 咳嗽吐血是什么原因| 李志为什么| 鹦鹉为什么会学人说话| 白羊男和什么星座最配| 政五行属什么| 百叶是什么| shake是什么意思| 桃花眼的女人什么命| 高血糖什么原因引起| 属猪与什么属相相合| 八方来财是什么意思| 脂肪肝吃什么中成药| 茵陈是什么植物| 红斑狼疮是什么引起的| 呼吸性碱中毒吃什么药| 耳朵里长痘是什么原因| 至死不渝是什么意思| 为什么会头晕| 雨后的彩虹像什么| 艾灸起水泡是什么原因| 羊癫疯有什么症状表现| 拉杆箱什么材质的好| t是什么火车| 全职是什么意思| 鼻窦炎用什么药效果最好| sherpa是什么面料| 四维彩超和大排畸有什么区别| 木牛流马是什么意思| 肾在什么位置| 鱼缸什么材质的好| 小便带血是什么原因| 芒果是什么季节的水果| 青蛙为什么叫| 脑供血不足吃什么中成药好| 吃什么补黑色素最快| 福寿螺有什么寄生虫| 晚上吃什么不发胖| 貌合神离是什么意思| 六味地黄丸有什么功效| 看胃挂什么科室| 幽门螺旋杆菌感染有什么症状| 汉尼拔什么意思| 淋巴用什么药可以消除| 8岁属什么| 百度
The Open Group Base Specifications Issue 8
IEEE Std 1003.1-2024
Copyright ? 2001-2024 The IEEE and The Open Group

NAME

dirname — return the directory portion of a pathname

SYNOPSIS

dirname string

DESCRIPTION

The string operand shall be treated as a pathname, as defined in XBD 3.254 Pathname, and shall be converted to a pathname of the directory containing the entry of the final pathname component. The resulting string shall be written to standard output. The dirname utility shall not perform pathname resolution; the result shall not be affected by whether or not a file with the pathname string exists or by its file type. Trailing '/' characters in string that are not also leading '/' characters shall not be counted as part of the pathname. If the pathname does not contain a '/', the resulting string shall be ".". If string is an empty string, the resulting string shall be ".".

It is unspecified whether redundant '/' characters and '.' pathname components in string are removed after determining the pathname to output. However, ".." pathname components occurring prior to the final component shall not be removed.

OPTIONS

None.

OPERANDS

The following operand shall be supported:

string
A string.

STDIN

Not used.

INPUT FILES

None.

ENVIRONMENT VARIABLES

The following environment variables shall affect the execution of dirname:

LANG
Provide a default value for the internationalization variables that are unset or null. (See XBD 8.2 Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.)
LC_ALL
If set to a non-empty string value, override the values of all the other internationalization variables.
LC_CTYPE
Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments).
LC_MESSAGES

Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.
NLSPATH
[XSI] [Option Start] Determine the location of messages objects and message catalogs. [Option End]

ASYNCHRONOUS EVENTS

Default.

STDOUT

The dirname utility shall write a line to the standard output in the following format:

"%s\n", <resulting string>

STDERR

The standard error shall be used only for diagnostic messages.

OUTPUT FILES

None.

EXTENDED DESCRIPTION

None.

EXIT STATUS

The following exit values shall be returned:

 0
Successful completion.
>0
An error occurred.

CONSEQUENCES OF ERRORS

Default.


The following sections are informative.

APPLICATION USAGE

The definition of pathname specifies implementation-defined behavior for pathnames starting with two <slash> characters. Therefore, applications shall not arbitrarily add <slash> characters to the beginning of a pathname unless they can ensure that there are more or less than two or are prepared to deal with the implementation-defined consequences.

EXAMPLES

The EXAMPLES section of the basename() function (see XSH basename()) includes a table showing examples of the results of processing several sample pathnames by the basename() and dirname() functions and by the basename and dirname utilities.

See also the examples for the basename utility.

RATIONALE

The behaviors of basename and dirname in this volume of POSIX.1-2024 have been coordinated so that when string is a valid pathname:

$(basename -- "string")

would be a valid filename for the file in the directory:

$(dirname -- "string")

This would not work for the versions of these utilities in early proposals due to the way processing of trailing <slash> characters was specified. Consideration was given to leaving processing unspecified if there were trailing <slash> characters, but this cannot be done; XBD 3.254 Pathname allows trailing <slash> characters. The basename and dirname utilities have to specify consistent handling for all valid pathnames.

The dirname utility is not specified in terms of the dirname() function, because the two may produce slightly different output where both output forms are still compliant. An implementation should prefer the shortest output possible; however, this is not required, in part because earlier versions of the standard did not permit elision of redundant <slash> characters or dot ('.') components. Removal of the dot-dot ("..") pathname component is not permitted, because eliding it correctly would require performing pathname resolution to ensure the resulting string would still point to the correct pathname if the original string resolved as a pathname. On implementations where pathname "//" has an implementation-defined meaning distinct from the pathname "/", the dirname of "//" will be "//".

FUTURE DIRECTIONS

If this utility is directed to display a pathname that contains any bytes that have the encoded value of a <newline> character when <newline> is a terminator or separator in the output format being used, implementations are encouraged to treat this as an error. A future version of this standard may require implementations to treat this as an error.

SEE ALSO

2.5 Parameters and Variables, basename

XBD 3.254 Pathname, 8. Environment Variables

XSH basename(), dirname()

CHANGE HISTORY

First released in Issue 2.

Issue 7

POSIX.1-2008, Technical Corrigendum 1, XCU/TC1-2008/0083 [192,430], XCU/TC1-2008/0084 [192], and XCU/TC1-2008/0085 [192] are applied.

POSIX.1-2008, Technical Corrigendum 2, XCU/TC2-2008/0086 [612], XCU/TC2-2008/0087 [620], and XCU/TC2-2008/0088 [612] are applied.

Issue 8

Austin Group Defect 251 is applied, encouraging implementations to report an error if a utility is directed to display a pathname that contains any bytes that have the encoded value of a <newline> character when <newline> is a terminator or separator in the output format being used.

Austin Group Defect 1073 is applied, replacing the DESCRIPTION section with one that matches the dirname() function.

Austin Group Defect 1122 is applied, changing the description of NLSPATH .

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 ]

动脉血检查是检查什么 眼袋青色什么原因 秒后面是什么单位 腾空是什么意思 湖北人喜欢吃什么菜
血糖30多有什么危险 厄警失痣是什么意思 oct试验是什么 全员加速中什么时候播 吃什么东西对胃好
吃什么好排大便 中央组织部部长什么级别 什么屈膝 小麦是什么 退烧吃什么药
拙作是什么意思 花胶是鱼的什么部位 单身领养孩子需要什么条件 石头五行属什么 肚子里面跳动是什么原因
什么是低保hcv9jop6ns3r.cn 男人吃叶酸片有什么好处hcv9jop6ns7r.cn 脂肪肝挂什么科hcv8jop9ns1r.cn 下焦湿热是什么意思hcv9jop2ns7r.cn 膝跳反射属于什么反射hcv8jop3ns9r.cn
头皮发痒是什么原因引起的hcv9jop3ns1r.cn 拉肚子吃什么药最有效hcv7jop9ns1r.cn 吃维生素c有什么好处hcv8jop0ns2r.cn 中国什么时候灭亡hcv9jop0ns1r.cn 六月二十四是什么日子hcv9jop3ns2r.cn
lt是什么hcv8jop2ns9r.cn 2e是什么意思hcv8jop3ns6r.cn h代表什么hcv7jop6ns8r.cn 吃姜对身体有什么好处yanzhenzixun.com 黄水疮用什么药膏最快hcv8jop9ns6r.cn
胸口疼挂什么科室hcv9jop0ns5r.cn 9月28是什么星座hcv8jop7ns8r.cn 梵高是什么画派hcv8jop0ns6r.cn 开火上下结构念什么hcv9jop8ns3r.cn 什么是佝偻病有什么症状hcv9jop4ns2r.cn
百度