[net.sources] rm ABC*

ajc (02/14/83)

Every once in a while some turkey program comes along and leaves
a file with some unprintable name.

You know it's there because when you do ls you see a file with a
name that prints (for instance) ABC?.

Yet when you do rm ABC? or even stranger rm ABC*, rm responds
"file nonexistent".

If the damn file is nonexistent, why does ls list it??  And if ls
thinks it's there, why can't rm remove it??  Or as Judy Garland
put it so eloquently so many years ago,
   Birds fly over the rainbow...
   Why then, oh why can't I.
~e
~e
~e
                     
~e
~e
~e
(oh, well, I guess ~e doesn't work either.  Guess it's just one
of those days!)

ken (02/16/83)

The file you have a hard time removing (ABC?) has some kind of unprintable
character in it; ls senses that it isn't printable and puts a '?' in place of
the unprintable character.  On earlier UNIX systems, there used to be a program
called "dsw" (a program with questionable etymology), which allowed you to
interactively delete files in the current directory.  "rm -i" is an attempt
to consolidate all the different types of removal programs, but it doesn't
fully take the place of dsw, because it doesn't change the unprintable
characters to a '?'.  Therefore, when you say "rm -i *", you never see "ABC?".

One suggestion is to do an "od -c .", and look for the file with the
unprintable character; then you can use one of various quoting mechanisms
to specifically delete the offending file.

Another is to find some sort of pattern that can uniquely describe the file,
such as "*BC*".  Try it out with "ls" first, then with "rm".

mat (02/16/83)

Yes, dsw(i) way to do it under generic UN*X (ie v6).  Dsw at one time read the
console switches to determine whether or not you wanted a file destroyed!
Rather unportable, I'd say.
As an aside, dsw comes from a telegrapher's abbreviation fo the Russian word
for ``so long'', which transliterates ``dossv'donye'' or ``DoSsW'donye''
This according to a person who got it from a person who overheard it from
someone who was reported to be a close friend of ... from someone who
claimed to actually have heard it from Ken.

goldfarb (02/20/83)

I guess the net runs in a pretty tight cycle, since this subject
was discussed last summer.  In any case, I adopted the following
method based on that previous discussion:

	1)  Do ls -i to find the inode number of the wierd file.
	2)  Do a find to get rid of it, e.g.:
	       find . -inum nnnn -exec rm -f {} \;

				Ben Goldfarb
				Univ. of Cent. Fla.
				...!duke!ucf-cs!goldfarb