fixing rm * (was: Worm/Passwords)

Alan Char achar at atari.UUCP
Tue Nov 15 10:39:36 AEST 1988


In article <672 at quintus.UUCP> ok at quintus.UUCP (Richard A. O'Keefe) writes:
|Now, how _do_ you fix "rm *"?  Suppose you restrict rm to delete exactly
|one file.  Watch:
|	foreach F (* .o)
|	    rm $F
|	end
|OOPS!  Major bug in foreach!  Better fix that.
|	[ other examples ]
|
|Moral: you can't change _one_ thing.

Actually, you can change the shell.  (Nowadays, that's more like three to
five things.)  For example, I would REALLY appreciate in csh a variable

	set expandcheck=5

So that if some shell expansion expanded to more than 5 things, it would
prompt for confirmation:

	% rm * .o
	*: matches 400 files, are you sure?

Comments on this idea?  --Alan



More information about the Comp.unix.wizards mailing list