From: pgr@ecs.ox.ac.uk (Partially Grown Rhododendron) Subject: Re: How do I delete file named "-I" ? Date: 15 Jun 1992 07:00:40 GMT
In <BpvF3L.J8u@news.cso.uiuc.edu>, Ben Cox <thoth@uiuc.edu> writes:
> jason@intrepid.ucr.edu (Jason Bishop) writes:
> > Try rm - -I Leading - tells rm that there are no arguments, all following
> > text are files to delete. Also works with cp, mv, etc...
> 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.
My suggestion is: go and ask on comp.unix.wizards. I'm sure they'll
appreciate it. It may take two or three weeks before the e-mail flames
die down, though, so be prepared to have a mail box full of comments
telling you:
This is a Unix FAQ. Please read the FAQ posting for Unix.
If you are using GNU rm (which I assume most Linux people are), then I
also assume you also have the GNU manual pages (If not, why not :-?).
Paragraph two of the manual page for rm is:
===============================================================================
GNU rm, like every program that uses the getopt function to
parse its arguments, lets you use the -- option to indicate
that all following arguments are non-options. To remove a
file called `-f' in the current directory, you could type
either
rm -- -f
or
rm ./-f
The Unix rm program's use of a single `-' for this purpose
predates the development of the getopt standard syntax.
===============================================================================
I think that this probably answers the question rather well (ok, so it
uses `-f' rather than `-I' but I expect most people can extrapolate).
Manual pages are always a good place to start looking for answers...
pihl "who didn't use the phrase `RTFM' once"