fixing rm * (was: Worm/Passwords)
Alan Char
achar at atari.UUCP
Thu Nov 17 08:31:43 AEST 1988
In article <684 at quintus.UUCP> ok at quintus.UUCP (Richard A. O'Keefe) writes:
|In article <1232 at atari.UUCP> achar at atari.UUCP (Alan Char) writes:
||I would REALLY appreciate in csh a variable
|| set expandcheck=5
|
|The trouble is that I can't think of a reasonable number for the limit:
|I do "egrep foo $dirs/*.c" (rummaging around in dozens of files) often
|enough that I'd find it a nuisance to have to clear a small limit. If
|you are doing something non-destructive to the files, you usually don't
|want a limit, it's only if you're over-writing or destroying the files
|that you have a problem.
Usually if I'm doing "egrep foo $dirs/*.c", I expect the command to take
a substantial (at least noticable) amount of time, so I don't think I'd
find it much of a nuisance to confirm my intentions. It just depends on
what your tolerance is for that kind of thing, I guess.
|And expandcheck _still_ wouldn't stop
|
| find . ! -user $LOGNAME -exec rm {} \;
|
|{remove all files not owned by me in the current subtree} -- forget the
|"!" and you lose big.
Personally, I would blame this on the syntax of find. This has nothing to
do with shell expansion generating something you didn't intend. It has to
do with an arcane syntax being prone to typographical catastrophes.
|The standard trick for csh is
| alias rm "/bin/rm -i"
Yes, but getting confirmed when you want to remove only one file? Every time?
That really IS a nuisance.
% rm core
rm: remove core?
--Alan Char
More information about the Comp.unix.wizards
mailing list