Interpretations

Answering questions that may arise related to the meaning of portions of an IEEE standard concerning specific applications.

IEEE Standards Interpretations for IEEE Std 1003.2™-1992 IEEE Standard for Information Technology--Portable Operating System Interfaces (POSIX®)--Part 2: Shell and Utilities

Copyright © 1996 by the Institute of Electrical and Electronics Engineers, Inc. 3 Park Avenue New York, New York 10016-5997 USA All Rights Reserved.

Interpretations are issued to explain and clarify the intent of a standard and do not constitute an alteration to the original standard. In addition, interpretations are not intended to supply consulting information. Permission is hereby granted to download and print one copy of this document. Individuals seeking permission to reproduce and/or distribute this document in its entirety or portions of this document must contact the IEEE Standards Department for the appropriate license. Use of the information contained in this document is at your own risk.

IEEE Standards Department, Copyrights and Permissions, 445 Hoes Lane, Piscataway, New Jersey 08855-1331, USA

Interpretation Request #74
Topic: rm exit status Relevant Clauses: 4.53

POSIX.2 Subclause 4.53 specifies the semantics of the “rm” utility. My question has to do with the correct behavior of “rm” when it is applied to an ordinary file that has no write permission, when standard input is a terminal. If file Foo has mode r--r--r-- (i.e., is not writeable), and the command rm Foo is issued, and the user, in response to a prompt asking if the file should be removed, responds negatively, then what value should the exit status have? My reading of the standard (subclause 4.53.8) is that it should be nonzero. However, I note that existing practice on all the systems to which I have access is to exit with status zero under these circumstances. Was it the intent of the committee to change the semantics from existing practice?

Interpretation Response
The standard states the behaviour for rm, and conforming implementations must conform to this. However, concerns have been raised about this which are being referred to the sponsor.

Rationale for Interpretation
None.