Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cmcl2!phri!marob!daveh From: daveh@marob.MASA.COM (Dave Hammond) Newsgroups: comp.unix.wizards Subject: Re: Ugly file name Message-ID: <672@marob.MASA.COM> Date: 19 May 89 01:29:18 GMT References: <105096@sun.Eng.Sun.COM> <9001@csli.Stanford.EDU> Reply-To: daveh@marob.masa.com (Dave Hammond) Organization: ESCC New York City Lines: 25 >Several alternatives have been suggested to uniquely identify the file >to be removed. However, there are cases in which `rm' won't do the job >of deleting the file because the shell which is used to run `rm' may >strip the eighth bit off characters [some shells do]. In such cases, it >is impossible to remove the file with `rm'. You could do a clri and fsck >but that is a little bit of overkill. A short C program will do (see my >other posting). I have found the `find' command quite useful in this respect. Find's filename expansion has no problem handling 8-bit characters, so something like: find . -exec rm -i {} \; will do the trick every time. Since find prepends "./" to each filename, there's even no problem removing a file which accidently got named "-f". Assuming you can latch on to some visible piece of the offending filename (try an `ls -q'), then add a -name arg to the `find' command line and cut down the number of "n"s you have to type while scanning for the bad filename. -- Dave Hammond daveh@marob.masa.com