Ghost file
Guy Harris
guy at auspex.UUCP
Wed Nov 23 06:57:25 AEST 1988
>I tried that (rm -i *) with a ghost file and it did NOT work. Dumped the
>directory and found that the file name had a printable letter, 0x08, and two
>more letters. The 0x08 (backspace) effectively masked the first letter.
>rm -i * would prompt with the name, and then give a file not found
error.
The only way I can believe that story is true is if you have an
excessively helpful shell, or if some of the "printable" letters really
had their 8th bit set and you had an insufficiently helpful shell. If
the file's name is "f<BS>duck", where "<BS>" refers to the "backspace"
character, doing "rm -i *" under a sane Bourne, Korn, or C shell would
cause "rm" to print something like
rm: remove duck?
(the word "remove" may be absent, depending on your UNIX version), and
if you say "y" it will quite cheerfully remove the file whose name it
printed - that name is "f<BS>duck", which happens to print as "duck" on
most terminals these days. No shell I know of will remove the printable
letter and backspace, nor will any UNIX kernel I know of.
If the 8th bit is set, the shell might strip the 8th bit off before
passing it to "rm", in which case "rm" will not have the proper name of
the file and will not be able to remove it. Versions of the Bourne
shell prior to the System V Release 3 version, and versions of the C
shell from Berkeley, will strip the 8th bit (as they use that bit
internally for quoting). The System V Release 3 Bourne shell (present
in SunOS 4.0 and later) will not strip the 8th bit.
More information about the Comp.unix.wizards
mailing list