[comp.unix.questions] deleting ugly file names

merlyn@intelob.intel.com (Randal L. Schwartz @ Stonehenge) (05/16/89)

In article <2252@Portia.Stanford.EDU>, joe@hanauma (Joe Dellinger) writes:
| Even "rm -i *" used to be dangerous. There is the famous case where
| somebody accidentally created a file name "-f", and decided to remove
| it by doing "rm -i *". The csh dutifully expanded this to
| "rm -i -f [files...]", and at that time "-f" overrode "-i" in rm.
| Result: everything in the directory deleted EXCEPT the file "-f"!
| Now -i overrides -f in rm, at least, but rm still interprets files
| beginning with a "-" as options instead of file names, even when expanded
| by the csh. I guess poor rm has no way of knowing what you typed and
| what the csh expanded.

Hasn't this one gotten into the folklore properly yet?  The *proper*
way to delete really nasty filenames is:

(1) find yourself a *dumb* terminal (at least something that doesn't
interpret control characters)

(2) cd to the directory where the beasty lives

(3) type "rm -ir ." CAREFULLY

(4) type a bunch of "n"s, followed by The One True "y" CAREFULLY
[the proper number of "n"s is left as an exercise to the reader]

(5) pour yourself a cold one (in my case, Classic Coke[tm])

No shell interpreter's gonna get in *my* way.  Works even on names
that have hi-bits set!  (Gurus know what I mean... if you don't know
what that is, don't ask.)

Just another UN*X Hacker,
-- 
***** PLEASE IGNORE THE ADDRESS IN THE HEADER *****
/=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095===\
{ <merlyn@agora.hf.intel.com> ...!uunet!agora.hf.intel.com!merlyn    }
\=Cute quote: "Welcome to Oregon... home of the California Raisins!"=/

bph@buengc.BU.EDU (Blair P. Houghton) (05/19/89)

In article <4438@omepd.UUCP> merlyn@intelob.intel.com (Randal L. Schwartz @ Stonehenge) writes:
>way to delete really nasty filenames is:
>
>(1) find yourself a *dumb* terminal (at least something that doesn't
>interpret control characters)

Hay!  I resemble that remark!

Get yerself a VT340, probably the _least_ "*dumb*" terminal ever before,
or ever again (considering everybody's buying windowing bitmap terminals
these days, and it's software, not the terminal, that provides all the
function, there) and switch the setup option for "Control Representation
Mode" from "interpret controls" to "display controls".

Do the rest of what Mr. Schwartz suggests (although it's overkill).

_Now_ grab a cold one (in my case it's a 750ml can of Fosters.
As in "the biggah the bettah, mate", except I'm not a little,
weasely yuppie, I'm a big, oafish, hippie-lookin' grad student. :)

				--Blair
				  "Hay!  I resemble that remark!"