View Issue Details

IDProjectCategoryView StatusLast Update
00005421003.1(2008)/Issue 7Shell and Utilitiespublic2019-06-10 08:55
Reportereblake Assigned Toajosey  
PrioritynormalSeverityObjectionTypeOmission
Status ClosedResolutionAccepted 
NameEric Blake
OrganizationRed Hat
User Referenceebb.rm
Sectionrm
Page Number3135
Line Number104163
Interp StatusApproved
Final Accepted TextSee 0000542:0002414.
Summary0000542: rm -f with no file operands
DescriptionOn 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 ActionAt line 104163 [XCU rm SYNOPSIS], change:
rm [−fiRr] file...

to:
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.

to:
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.
Tagstc2-2008

Activities

Don Cragun

2012-02-16 17:09

manager   bugnote:0001132

The standard was silent on the behavior when no operands are present, but all known implementations already behave as described.

rhansen

2014-10-06 19:59

manager   bugnote:0002407

NetBSD 4 prints a usage message and exits non-0 when you run 'rm -f' without any file operands.

Don Cragun

2014-10-09 15:16

manager   bugnote:0002414

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.

Rationale:
-------------
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

2014-10-15 11:21

manager   bugnote:0002422

Interpretation proposed: 15 Oct 2014

ajosey

2014-11-27 10:31

manager   bugnote:0002448

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 0000542: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