From: Charles Hedrick (hedrick@dumas.rutgers.edu)
Date: 06/15/92


From: hedrick@dumas.rutgers.edu (Charles Hedrick)
Subject: Re: How do I delete file named "-I" ?
Date: 15 Jun 1992 07:22:07 GMT

thoth@uiuc.edu (Ben Cox) writes:

>Unfortunately, that doesn't work. "rm - -I" gives "rm: -: No such
>file or directory". This is the standard answer to this question,
>though, and I have never gotten it to work on any unix system. The
>BSD manpage even says that this is the answer. It is not.

Well, it works under SunOS. Sounds like POSIX strikes again. There
are a zillion ways to do this. Fortunately another one seems to make
it past POSIX. Try "rm ./-I". "." is the current directory. It's
normally sort of silly to say ./x, since that's equivalent to simply
"x", but in this case it avoids having the name start with -, so it
solves the problem. This hack should work with any program, unlike
the "-" option, which the program has to be written to understand.