[Top][All Lists]

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

bug with rm

From: Otheus
Subject: bug with rm
Date: Wed, 23 Jul 2008 11:08:05 +0200


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."

reply via email to

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