rm can accidentally delete dirs

Skiboo <[email protected]>
Newsgroups gmane.comp.gnu.fileutils.bugs
Message-ID <[email protected]>
Toying with rm today, and came across this situation.
You've got a file called "-n". Now, rm will interperet
'rm -n' as an argument (this isn't the bug). So you go
'rm -- -n', and everything is fine.

However, since it tries to interperet these filenames
as arguments, some problems come up.
Say you've got a file called '-rf', a file called
test,  and a dir called testdir.

rm *f t*    should delete '-rf' and the  test file,
leaving the directory, however, it interperates -rf as
arguments, deleteing the folder and its contents. (It
also leaves the -rf file).

 -- Kavity and naka

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.