--- Begin Message ---
Subject: |
rm -I vs. rm --interactive=once |
Date: |
Tue, 16 Aug 2011 01:31:06 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20110628 Thunderbird/5.0 |
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
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#9308: [PATCH] Proposed fix |
Date: |
Wed, 25 Sep 2013 11:55:32 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 |
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
Description: Text Data
--- End Message ---