[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug#10819: [BUG][RM]

From: Eric Blake
Subject: Re: bug#10819: [BUG][RM]
Date: Thu, 16 Feb 2012 14:08:28 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20120131 Thunderbird/10.0

[dropping coreutils, as we are now moving on to what autoconf should

On 02/16/2012 11:58 AM, Eric Blake wrote:
> As would I.  My tests were pretty extensive, hitting some rather old
> machines:
> FreeBSD 6.4
> AIX 5.1
> HP-UX 10.20
> IRIX 6.5
> Solaris 2.6 (both /bin/rm and /usr/xpg4/bin/rm)
> Tru64 UNIX 5.1
> In all cases, 'rm' gave a usage message and non-zero status, 'rm -f' was
> silent with status 0.

What I did not test was NetBSD.  After reading what is currently in the
autoconf manual, I did a source search, and
shows it was fixed only in May 2008 (arguably as a fix to comply with
POSIX, even though POSIX at that time did not require it :)  Four years
is a relatively long time, do we suspect that NetBSD from that long ago
is still in active use?

>> so that we could simplify a bunch of automake recipes); but a more extensive
>> probing is needed in this matter I guess.  And if you are right (as I hope),
>> then this 'rm' feature could be documented in the Autoconf manual.
> Yep, I think that's appropriate, as it is unlikely that we will come up
> with any counterexamples any time soon.

Does this look reasonable, then?

        docs: tweak 'rm -f' limitations
        * doc/autoconf.texi (Limitations of Usual Tools) <rm>: More
        details on 'rm -f' without files.

diff --git i/doc/autoconf.texi w/doc/autoconf.texi
index 82837a2..eee3234 100644
--- i/doc/autoconf.texi
+++ w/doc/autoconf.texi
@@ -19225,10 +19225,12 @@ Limitations of Usual Tools
 @prindex @command{rm}
 The @option{-f} and @option{-r} options are portable.

-It is not portable to invoke @command{rm} without operands.  For
-example, on many systems @samp{rm -f -r} (with no other arguments)
-silently succeeds without doing anything, but it fails with a diagnostic
-on NetBSD 2.0.2.
+It is not portable to invoke @command{rm} without options or operands.
+These days, Posix requires @command{rm -f} (but not @command{rm} in
+isolation) to silently succeed when there are no operands (useful for
+constructs like @command{rm -rf $filelist} without first checking if
address@hidden was empty), but this was not always portable; at least
+NetBSD @command{rm} built before 2008 would fail with a diagnostic.

 A file might not be removed even if its parent directory is writable
 and searchable.  Many Posix hosts cannot remove a mount point, a named

Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]