Xref: utzoo comp.unix.xenix:5961 comp.unix.questions:13568 comp.unix.wizards:16120 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!agate!shelby!Portia!hanauma!joe From: joe@hanauma.stanford.edu (Joe Dellinger) Newsgroups: comp.unix.xenix,comp.unix.questions,comp.unix.wizards Subject: Re: Ugly file name Keywords: rm cat mv regexp Message-ID: <2214@Portia.Stanford.EDU> Date: 12 May 89 15:58:56 GMT References: <128@tdl.UUCP> <7170@bsu-cs.bsu.edu> Sender: USENET News System Reply-To: joe@hanauma.stanford.edu (Joe Dellinger) Distribution: usa Organization: Stanford University, Dept. of Geophysics Lines: 22 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. In another similar vein, I have a friend that recently had a junk directory created by some sort of nasty low-level software error on a Sun 3. It was like a black hole in the file system; you could cd into it but "cd .." would then just leave you there. If you did "rmdir" it would complain the directory wasn't empty. If you did "rm -r" it would go into an infinite loop trying to work down to the bottom of the infinite pit, and would finally core dump. "fsck" thought there was nothing wrong with the directory. We were really puzzled with this one, but finally the little-used "clear inode" command followed by a fsck did the trick. It was such a wonderful unique object, it was almost a shame to kill it. \ /\ /\ /\/\/\/\/\/\/\.-.-.-.-.......___________ \ / \ / \ /Dept of Geophysics, Stanford University \/\/\.-.-....___ \/ \/ \/Joe Dellinger joe@hanauma.stanford.edu apple!hanauma!joe\/\.-._