Subject: "rm *" files "-f" and "-r" - weird behaviour...
To: None <tech-userlevel@netbsd.org>
From: Ian Zagorskih <ianzag@megasignal.com>
List: tech-userlevel
Date: 01/20/2006 18:12:36
$ uname -a
NetBSD IANZAG 3.99.15 NetBSD 3.99.15 (GENERIC.MPACPI) #0: Tue Jan 10 23:03:24
NOVT 2006
toor@NBSD1:/usr/build/obj/i386/sys/arch/i386/compile/GENERIC.MPACPI i386
$ ls -l
$ mkdir foo
$ touch foo/file1 foo/file2 foo/file3
$ ls -lR
total 4
drwxr-xr-x 2 ianzag users 512 Jan 20 18:11 foo
./foo:
total 0
-rw-r--r-- 1 ianzag users 0 Jan 20 18:11 file1
-rw-r--r-- 1 ianzag users 0 Jan 20 18:11 file2
-rw-r--r-- 1 ianzag users 0 Jan 20 18:11 file3
$ echo > -r
$ echo > -f
$ ls -lR
total 12
-rw-r--r-- 1 ianzag users 1 Jan 20 18:11 -f
-rw-r--r-- 1 ianzag users 1 Jan 20 18:11 -r
drwxr-xr-x 2 ianzag users 512 Jan 20 18:11 foo
./foo:
total 0
-rw-r--r-- 1 ianzag users 0 Jan 20 18:11 file1
-rw-r--r-- 1 ianzag users 0 Jan 20 18:11 file2
-rw-r--r-- 1 ianzag users 0 Jan 20 18:11 file3
$ rm *
$ ls -lR
total 8
-rw-r--r-- 1 ianzag users 1 Jan 20 18:11 -f
-rw-r--r-- 1 ianzag users 1 Jan 20 18:11 -r
$
IMHO quite weird rm behavior, no? :)
// wbr