Re^2: an rm question
Kim Chr. Madsen
kimcm at ambush.UUCP
Wed Apr 20 19:25:56 AEST 1988
In article <49968 at sun.uucp> limes at sun.uucp (Greg Limes) writes:
>In article <670012 at hpclscu.HP.COM>, shankar at hpclscu.HP.COM (Shankar Unni) writes:
>> Let's say that you managed to create a file called
>> "a.*\03\07^q". If you just typed in rm a.*\03\07^q, the *shell* steps in
>> and does nasty stuff.
I used to have a little util called "erase" around when I was working
on a system where you couldn't remove files with 8'th bit set in the
filenames nor would ls(1) show the filename properly, so you had to do
an od(1) on "." to get the real name. The program had no parameters
but checked the current directory for funny filenames and interactively
asked the user whether to remove this or that funny file.
If anyone interrested I might have the source somewhere...!
>Try using "./" before the filename. For instance, if you have a file
>called "-rf *" in your current directory, the command "rm './-rf *'"
>would get rid of it. Note the single quotes here, too.
I would not use this command or propagate its use -- it's too damn
dangerous if you forget the single quotes or have them replaced with
double quotes! rather would I make a small C-program:
main() { unlink("-rf *"); }
which would guarantee that at most ONE file would be removed!
Kim Chr. Madsen, AmbraSoft A/S, Rojelskaer 15, DK-2840 Holte (Denmark)
UUCP: kimcm at ambush.dk, PHONE: +45 2424 111, FAX: +45 2423 090
Though I am not naturally honest, I am so sometimes by chance.
-- William Shakespeare
More information about the Comp.unix.wizards
mailing list