GNU bug report logs - #9308
rm -I vs. rm --interactive=once

Previous Next

Package: coreutils;

Reported by: drudolf <at> phrozenbyte.de

Date: Tue, 16 Aug 2011 00:06:01 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: drudolf <at> phrozenbyte.de
Subject: bug#9308: closed (Re: bug#9308: [PATCH] Proposed fix)
Date: Wed, 25 Sep 2013 10:56:05 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#9308: rm -I vs. rm --interactive=once

which was filed against the coreutils package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 9308 <at> debbugs.gnu.org.

-- 
9308: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9308
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Pádraig Brady <P <at> draigBrady.com>
To: Sergio Durigan Junior <sergiodj <at> sergiodj.net>
Cc: 9308-done <at> debbugs.gnu.org
Subject: Re: bug#9308: [PATCH] Proposed fix
Date: Wed, 25 Sep 2013 11:55:32 +0100
[Message part 3 (text/plain, inline)]
On 09/23/2013 04:37 AM, Sergio Durigan Junior wrote:
> Hi,
> 
> This bug is simple enough that it took only a one-liner to fix it.  I
> believe it makes sense, because (as correctly pointed out by Daniel),
> rm's manpage explicitly mentions that -I and --interactive=once should
> be the same.
> 
> Tested here, without failures.  I already have commit access to the
> GDB/binutils repo, so if you want to just extend my commit rights to
> commit to the coreutils, that's fine too.

The change looks correct, thanks.
I've added NEWS, and tests in the attached and will push soon.

thanks,
Pádraig.


[rm-I.patch (text/x-patch, attachment)]
[Message part 5 (message/rfc822, inline)]
From: Daniel Rudolf <drudolf <at> phrozenbyte.de>
To: bug-coreutils <at> gnu.org
Subject: rm -I vs. rm --interactive=once
Date: Tue, 16 Aug 2011 01:31:06 +0200
Hi,

according to the --help message and the manual of rm, the parameters
"-I" and "--interactive=once" should be absolutely identical. But when
you're deleting an unwritable file with parameter "-I", rm does not
prompt for this file. When you're using "--interactive=once" rm is
prompting.

> $ touch file1 && chmod -w file1
> $ touch file2 && touch file3 && touch file4
> $ ls -l
> insgesamt 0
> -r--r--r-- 1 daniel daniel 0 2011-08-16 00:52 file1
> -rw-r--r-- 1 daniel daniel 0 2011-08-16 00:57 file2
> -rw-r--r-- 1 daniel daniel 0 2011-08-16 00:57 file3
> -rw-r--r-- 1 daniel daniel 0 2011-08-16 00:57 file4
> $ LC_ALL=C rm --interactive=once file1 file2 file3 file4
> rm: remove all arguments? y
> rm: remove write-protected regular empty file `file1'? y
> $
As you can see rm prompts for the unwritable file "file1".

> $ touch file1 && chmod -w file1
> $ touch file2 && touch file3 && touch file4
> $ LC_ALL=C rm -I file1 file2 file3 file4
> rm: remove all arguments? y
> $
Now rm does not prompt for the unwritable file "file1".

This also happens if you're deleting "file1" only.

My system:
$ LC_ALL=C rm --version
rm (GNU coreutils) 7.4
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Paul Rubin, David MacKenzie, Richard M. Stallman,
and Jim Meyering.
$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 10.04.3 LTS
Release:	10.04
Codename:	lucid
$ uname -a
Linux HP-Pavilion-Ubuntu 2.6.32-23-generic #37-Ubuntu SMP Fri Jun 11
08:03:28 UTC 2010 x86_64 GNU/Linux

Greetings,

Daniel Rudolf



This bug report was last modified 11 years and 244 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.