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

Larry McVoy lm at snafu.Sun.COM
Thu Jan 11 10:13:13 AEST 1990


In article <1990Jan10.143111.3446 at virtech.uucp> jje at virtech.uucp (Jeremy J. Epstein) writes:
>In article <130045 at sun.Eng.Sun.COM>, lm at snafu.Sun.COM (Larry McVoy) writes:
>> 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
>> >
>> 
>> $ 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
>
>Unfortunately this won't work since the shell is responsible
>for expanding the ? and * wildcard characters, not the kernel
>(just for fun, consider implementing a shell which used different
>wildcard characters...it's only confusing to the user).

You're out of your mind.  The shell does not come inbetween a the keyboard
and gets().
---
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