Greetings,

I'm a very long-time unix user, and I just noted that in RHEL5, version 5.97
(and reproduced again on 6.9) of coreutils, the rm command behaves
improperly: It prompts the user for removal of a read-only file, even when
the -i option is not specified (using /bin/rm, no aliases, etc). Further, it
removes it when input is provided by /dev/null.  Essentially, there is no
way to use the rm command to skip over read-only files without prompting the
user!! This is a serious bug, IMHO. While there is a 'yes' command to force
an arbitrary answer to all commands ("yes n" will produce line-terminated
"n"'s until the pipeline terminates), it does not work with rm!!

$ touch test
$ chmod u-w test
$ rm test
rm: remove write-protected regular empty file `test'?

The following also incorrectly remove the file:
$ touch test
$ chmod u-w test
$ rm test </dev/null

$ touch test
$ chmod u-w test
$ yes "n" | rm test

I shudder to think of the disastrous consequences this has had.



-- 
WC Fields  - "A rich man is nothing but a poor man with money."
_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to