On Fri, 08 Nov 2002 13:31, Matthew Gregan wrote:
> On Fri, Nov 08, 2002 at 12:45:10PM +1300, Michael JasonSmith wrote:
> > One of the things I like to do is put a file called "0000AAAA" in my
> > home directory ("touch ~/0000AAAA"). Then remove read and write
> > permissions
> > ("chmod 000 ~/0000AAAA"). Then, when I try and remove my home directory
> > I get the message along the lines of
> > rm: remove write-protected regular empty file
> > `/home/phd/mpj17/0000AAAA'?
> > and I can do a <control-c>. Not fool-proof (damn "-f") but it can help.
>
> This only works in a small number of cases. What happens when the list
> of files 'rm' is operating on is not in alphabetical order? Game over.
> There is no guarantee that '0000AAAA' will one of the first files that
> 'rm' attempts to remove.
a better, but still imperfect, way is to call the file "./-i" because 99% of
the time it ensures that rm works interacively ( the exception being that one
where there is a file in the dir which sorts before "-" )
--
Sincerely etc.,
Christopher Sawtell