Austin Group Defect Tracker

Aardvark Mark IV

Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0000542 [1003.1(2008)/Issue 7] Shell and Utilities Objection Omission 2012-02-16 15:24 2019-06-10 08:55
Reporter eblake View Status public  
Assigned To ajosey
Priority normal Resolution Accepted  
Status Closed  
Name Eric Blake
Organization Red Hat
User Reference ebb.rm
Section rm
Page Number 3135
Line Number 104163
Interp Status Approved
Final Accepted Text See Note: 0002414.
Summary 0000542: rm -f with no file operands
Description On all the implementations that I tried (Solaris, GNU/Linux, HP-UX, AIX,
FreeBSD, Irix, Tru64), the command 'rm -f' exits with 0 status and no
message. This is intentional behavior, allowing scripts to do things
like 'rm -f $filelist' without having to first check whether $filelist
contains any words. The standard states (line 104209) that when -f is
in effect, no diagnostic messages or exit status changes occur for
nonexistent operands, but it could be argued that this text is ambiguous
(does it mean the case where no operands were supplied, or only the
case where an operand was supplied but names a file that does not exist?);
and the synopsis claims that at least one file argument is required for
a standard-compliant usage. Since everyone already supports the case
of 'rm -f' with no operands, we should allow that in the standard.
Desired Action At line 104163 [XCU rm SYNOPSIS], change:
rm [−fiRr] file...

rm [−iRr] file...
rm -f [−iRr] [file...]

At line 104209 [OPTIONS], change:
Do not write diagnostic messages or modify the exit status in the case
of nonexistent operands.

Do not write diagnostic messages or modify the exit status in the case
of no file operands, or in the case of operands that do not exist.
Tags tc2-2008
Attached Files

- Relationships

-  Notes
Don Cragun (manager)
2012-02-16 17:09

The standard was silent on the behavior when no operands are present, but all known implementations already behave as described.
rhansen (manager)
2014-10-06 19:59

NetBSD 4 prints a usage message and exits non-0 when you run 'rm -f' without any file operands.
Don Cragun (manager)
2014-10-09 15:16

Interpretation response

The standard does not speak to this issue, and as such no conformance distinction can be made between alternative implementations based on this. This is being referred to the sponsor.

The standard did not specify the behavior of the rm utility when it is invoked with no operands. Recent implementations of the utility all provide the behavior suggested so we are adding this extension to the requirements since many applications use this feature.

Notes to the Editor (not part of this interpretation):
Make the changes suggested in the Desired Action.
ajosey (manager)
2014-10-15 11:21

Interpretation proposed: 15 Oct 2014
ajosey (manager)
2014-11-27 10:31

Interpretation approved 27 November 2014

- Issue History
Date Modified Username Field Change
2012-02-16 15:24 eblake New Issue
2012-02-16 15:24 eblake Status New => Under Review
2012-02-16 15:24 eblake Assigned To => ajosey
2012-02-16 15:24 eblake Name => Eric Blake
2012-02-16 15:24 eblake Organization => Red Hat
2012-02-16 15:24 eblake User Reference => ebb.rm
2012-02-16 15:24 eblake Section => rm
2012-02-16 15:24 eblake Page Number => 3135
2012-02-16 15:24 eblake Line Number => 104163
2012-02-16 15:24 eblake Interp Status => ---
2012-02-16 17:09 Don Cragun Note Added: 0001132
2012-02-16 17:09 Don Cragun Status Under Review => Resolved
2012-02-16 17:09 Don Cragun Resolution Open => Accepted
2012-02-16 17:09 Don Cragun Tag Attached: tc2-2008
2014-10-06 19:59 rhansen Note Added: 0002407
2014-10-09 15:16 Don Cragun Interp Status --- => Pending
2014-10-09 15:16 Don Cragun Note Added: 0002414
2014-10-09 15:16 Don Cragun Status Resolved => Interpretation Required
2014-10-09 15:16 Don Cragun Final Accepted Text => See Note: 0002414.
2014-10-15 11:21 ajosey Interp Status Pending => Proposed
2014-10-15 11:21 ajosey Note Added: 0002422
2014-11-27 10:31 ajosey Interp Status Proposed => Approved
2014-11-27 10:31 ajosey Note Added: 0002448
2019-06-10 08:55 agadmin Status Interpretation Required => Closed

Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker