[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
rm can accidentally delete dirs
From: |
Skiboo |
Subject: |
rm can accidentally delete dirs |
Date: |
Fri, 7 Feb 2003 23:26:46 -0800 (PST) |
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
- rm can accidentally delete dirs,
Skiboo <=