From: utzoo!decvax!harpo!npois!ucbvax!ARPAVAX:CAD:teklabs!tekid!clives
Newsgroups: net.followup
Title: Re: rm -. and ??????
Article-I.D.: tekid.55
Posted: Sat Jun 12 22:05:01 1982
Received: Mon Jun 14 00:44:34 1982
Reply-To: !clives

Seems like the easiest way I've found to rm problem filenames (Murphy's law
says these things get generated in the top of trees) is the following:

(No comments on explanatory style, please, you experts already know how).

1. cd to the directory, then od -c . > temp.c

2. In temp.c, find the line(s) which contains the monster(s), and delete
   the rest. See hints below. Each line will look like this:

	0000360 303   "   j   u   n   k 222   \t   n   a   m   e  \0  \0  \0  \0

3. Delete the first 3 elements, (3dw in vi) which are the dump byte label
   and the file system pointer, leaving the 14 char file name with non-ascii
   in \x or octal number notation:

	j   u   n   k 222   \t   n   a   m   e  \0  \0  \0  \0

4. Then put backslash in front of any numbers which don't already have one:

	j   u   n   k \222   \t   n   a   m   e  \0  \0  \0  \0

5. Remove all blanks from the string(s) (:%s/ //g does this in vi), leaving:
	
	junk\222\tname\0\0\0\0

6. Write C like the following around the name(s):

	main ()
	{
	unlink("junk\222\tname\0\0\0\0\0"); /* 1 line like this for each name */
	}

7. Leave the editor, cc temp.c, run a.out, and your junk should be gone.


Hints:

It may seem a little difficult the first time to find real wierd junk files
in the od output (the kind which ls shows as cr?u??d???). The ?'s usually
represent non-ascii bytes, shown by their octal or \x values, as 222 and \t
are above.

There will probably be some extra names shown in the dump besides presently
active ones.  In these inactive labels, the pointer (first and second byte,
which are the second and third element of the dump lines) will be \0 \0:

0000420  \0  \0   n   o   t   _   u   s   e   d   _   n   o   w  \0  \0

Removing them from the dump file will leave you with lines which should match
one for one with your ls (-a). 



Incidentally, some of the filenames I've had to wipe around here..........


			Clive Steward
			Tektronix, Beaverton.