remove file "--help"?

remove file "--help"?

Post by Emarit Ra » Fri, 10 Jun 1994 14:04:32



        Don't ask how, if I knew I would not have done it   :P   but I have
        a file (in /sbin no doubt) by the name of "--help".  I want to remove
        it.  Of course rm --help is self defeating for this purpose, and
        "rm -i *" will get to the "--help" and sure enough I get the help
        screen.  The two X filemanagers I have fail at removing this ugly
        file.  How can I delete it?  I was thinking that copying everything
        BUT that file into a new directory and "rm -fr /sbin" to kill the old
        one then rename the new one to sbin would work, but removing /sbin
        files does not go well with me.  If all else fails I'll have to mount
        the file system with a root disk and fix the sbin while no process
        is trying to use it.  But there must be an easier way.  I would be
        most grateful if some one had some keen ideas on this one!

--
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Emarit                                          President of the
                                   Colorado State University Amateur Radio Club

_._  __.  _____  _._.  __._                          KG0CQ
*******************************************************************************

 
 
 

remove file "--help"?

Post by Steinar Midtskog » Fri, 10 Jun 1994 14:56:00


Include a path in the filename so it wont start with a '-', e.g. rm ./--help.

- Steinar

 
 
 

remove file "--help"?

Post by NJ. Brut » Fri, 10 Jun 1994 20:03:33


You should be able to say rm - --help

Nick

 
 
 

remove file "--help"?

Post by Bill Hog » Sat, 11 Jun 1994 18:01:16


: You should be able to say rm - --help

  For some reason, I love this question.

       "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."

       [from 'man rm']

  <BH
--
  Bill Hogan

 
 
 

remove file "--help"?

Post by thomas roettge » Sat, 11 Jun 1994 21:52:38


   You should be able to say rm - --help

   Nick

close. try rm -- --help

tom