MLUG: Re: [MLUG] deleting a file named '-'
Re: [MLUG] deleting a file named '-'
Email address obfuscation in effect -- please click here to turn it off.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
On Thu, 1 Mar 2001, Rob Judd wrote:

> It is rm seeing the dash as an option that causes problems.  To get
> around this you can call it with:
> 
> rm [options] -- [filenames]
> 
> The '--' causes rm to stop processing options and treat everything else
> as a filename.

Thanks!  That was a very clear explanation and it gives the best
solution.  I Read The F Man page, but look where they hide that info in
Solaris:

NOTES
     A -- permits the user to mark explicitly the end of any com-
     mand  line  options, allowing rm to recognize file arguments
     that begin with a -.  As an aid to BSD  migration,  rm  will
     accept - as a synonym for --.  This migration aid may disap-
     pear in a future release.  If a -- and a -  both  appear  on
     the  same  command line, the second will be interpreted as a
     file.

Can you believe it?  It's tacked on to the very end of the man page.  I
think they should put "--" on top with the other options (-f, -i, etc.).

So thanks!

Mike

--
To manage your subscription, go to http://mlug.missouri.edu/members/edit.php

Archives are available at http://mlug.missouri.edu/list-archives/