*BSD News Article 42928


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!msunews!uwm.edu!cs.utexas.edu!swrinde!gatech!udel!news.mathworks.com!newshost.marcam.com!uunet!newton.burton.frostburg.md.us!newton.burton.frostburg.md.us!not-for-mail
From: brian@newton.burton.frostburg.md.us (Brian Burton)
Newsgroups: comp.unix.bsd
Subject: Re: Removing a file with a leading "-" in the name
Date: 26 Feb 1995 17:45:52 -0500
Organization: none
Lines: 23
Message-ID: <3ir0b0$9f@newton.burton.frostburg.md.us>
References: <1995Feb20.023938.20960@rai.juice.or.jp> <3iedls$hks@ixnews3.ix.netcom.com> <3ij68m$39g@news.parc.xerox.com>
NNTP-Posting-Host: newton.burton.frostburg.md.us

In article <3ij68m$39g@news.parc.xerox.com>,
Peter MacLeod <macleod@adoc.xerox.com> wrote:
>Lisa B. (lisab@ix.netcom.com) wrote:
>: In <1995Feb20.023938.20960@rai.juice.or.jp> tetsuji@rai.juice.or.jp
>: (Tetsuji Rai) writes:
>: >Simply use unix commands.   I just made a file "-.rej" by mistake, and
>: >wondering how to erase it without programming.  Somehow rm recognizes
>: >"-" character as an option.
>
>You can say:
>
>% rm ugh -.rej
>rm: ugh: No such file or directory
>
>but it will still remove "-.rej", at least on my workstation. "rm" doesn't
>look for "-" after it sees a non "-" argument.
>

Many UNIX commands accept -- to mean "end of options" so you can use

   rm -- -.rej

++Brian