> I have a file called "-foo", and /bin/rm cannot remove it because it
> keeps trying to see the "-" as a command-line option. In pre-gnu
> days, I'd do "rm - -foo" and it'd work, but now it doesn't. If
> there's a way to do this, it should be mentioned in the --help text.
> (That is, have a "-" option that ignores all succeeding option flgas,
> like grep's "-e" flag.)
[...]
> BTW, I know I can do "rm ./-foo", but that's not always intuitive,
> thus the suggestion to have a "-" option for this.

You can always use the '--' option to specify that there are no more
options to be processed.  Then commands won't think that the filename
is an option because it will know that it is through with options.

  rm -- -foo

Bob

Reply via email to