How to delete a file with ^? chars in the name?

Larry McVoy lm at snafu.Sun.COM
Wed Jan 10 08:44:45 AEST 1990


In article <7711 at unix.SRI.COM> ubi at ginger.sri.com (Ron Ueberschaer x4399) writes:
>I have a file which is named ^?^?^?H01.b (delete character?) and can't
>find a way to delete it.  An ls -s on the directory produces:
>
>   ..	... (other files)
>    1	???H01.b
>
>If I do an ls *.b, it lists the other .b files, but complains:
>
>	H01.b not found
>
>I've tried:
>
>	rm -i *			(to selectively delete everything)
>	rm "???H01.b"
>	rm "^v^?^v^?^v^?H01.b"  (control-v delete ...)
>
>and nothing seems to work.

$ cat > xxx.c
#include <stdio.h>
main()
{
	char buf[255];

	while (gets(buf))
		if (unlink(buf))
			perror(buf);
}
^D
$ cc xxx.c
$ a.out
????H01.b
^D

---
What I say is my opinion.  I am not paid to speak for Sun, I'm paid to hack.

Larry McVoy, Sun Microsystems     (415) 336-7627       ...!sun!lm or lm at sun.com



More information about the Comp.unix.wizards mailing list