Xref: utzoo comp.unix.questions:13569 comp.unix.wizards:16121 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!agate!shelby!Portia!hanauma!joe From: joe@hanauma (Joe Dellinger) Newsgroups: comp.unix.questions,comp.unix.wizards Subject: Re: Ugly file name Keywords: rm cat mv regexp Message-ID: <2252@Portia.Stanford.EDU> Date: 13 May 89 08:52:50 GMT References: <128@tdl.UUCP> <7170@bsu-cs.bsu.edu> Sender: USENET News System Reply-To: joe@hanauma.stanford.edu (Joe Dellinger) Distribution: na Organization: Stanford University, Dept. of Geophysics Lines: 24 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. 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 destroy it. Maybe it connected to the file system of a Sun in another galaxy! \ /\ /\ /\/\/\/\/\/\/\.-.-.-.-.......___________ \ / \ / \ /Dept of Geophysics, Stanford University \/\/\.-.-....___ \/ \/ \/Joe Dellinger joe@hanauma.stanford.edu apple!hanauma!joe\/\.-._