Gentoo Archives: gentoo-dev

From: Josh Glover <jmglov@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Re: rm tragedies: was how to clean the "/tmp" dir
Date: Sun, 30 May 2004 15:42:36
Message-Id: 20040530154230.GG27048%jmglov@jmglov.net
In Reply to: [gentoo-dev] Re: rm tragedies: was how to clean the "/tmp" dir by Eamon Caddigan
1 Quoth Eamon Caddigan (Sun 2004-05-30 03:07:15PM +0000):
2
3 > marduk <marduk@g.o> wrote:
4 >
5 > > Don't change rm's default behavior. There is nothing wrong with rm.
6 > > There are many people who have for years (decades?) used rm and expect
7 > > it to work a certain way, i.e. the Unix way, which is to (wrongly?)
8 > > assume the user knows what she is doing and to quietly exit
9 > > successfully. If you must have new behavior, have a new command, say
10 > > gentoorm. Or if you must mess with rm, make sure by default it uses
11 > > traditional Unix behavior unless you pass it
12 > > --some-nonstandard-option-that-otherwise-breaks-rm. But please don't
13 > > change the way most people expect rm to work.
14 >
15 > Argumentum ad antiquitam. I'm aware of many good arguments for keeping
16 > 'rm' the way it is, but "because it's always been that way" isn't the
17 > strongest. :)
18
19 Sure it is. Have you noticed that the behaviour of basic Unix commands
20 (cp, rm, mv, echo, cat, grep, sed... and so on, almost ad nauseum) has
21 not changed since the days of yore? Sure, new behaviour has been added,
22 and in the case of lots of the GNU stuff, the new behaviour is almost
23 always used, but it has to be enabled somehow. The defaults have
24 remained the same! This is important! Do you know how many shell
25 scripts the average sysadmin has in his toolkit? Scripts that were
26 written years ago, and have been honed to a razor-sharp point, scripts
27 that might actually be bug-free? Now, what would happen if the
28 *default* behaviour of 'rm' or 'mv' changed? Most likely, a
29 catastrophe!
30
31 This is why aliases like Red Hat sets up for rm, mv, and cp are
32 a terrible idea in my opinion. Creating aliases like 'safe-rm' and
33 so on would be much better, because then the conditioning would
34 lead to 'bash: safe-rm: command not found', instead of 'rm'
35 "failing" to prompt you and thus enabling you to do untold damage
36 to a production system.
37
38 > As for nonstandard options, that's exactly what I propose. Appealing to
39 > tradition myself, I should point out that Linux has a rich history of
40 > adding nonstandard options to ancient UNIX commands.
41
42 I assume that, in this context, by "Linux", you actually mean "GNU",
43 right?
44
45 Add non-standard options all you want, but *do not* change the
46 default behaviour of core commands!
47
48 --
49 Josh Glover
50
51 Gentoo Developer (http://dev.gentoo.org/~jmglov/)
52 Tokyo Linux Users Group Listmaster (http://www.tlug.jp/)
53
54 GPG keyID 0xDE8A3103 (C3E4 FA9E 1E07 BBDB 6D8B 07AB 2BF1 67A1 DE8A 3103)
55 gpg --keyserver pgp.mit.edu --recv-keys DE8A3103

Replies

Subject Author
[gentoo-dev] Re: rm tragedies: was how to clean the "/tmp" dir Eamon Caddigan <ecaddiga@××××.edu>