Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Apr 2003 13:15:07 +1000
From:      Enno Davids <enno@doc.metva.com.au>
To:        Jim Weeks <jim@jwweeks.com>, freebsd-isp@freebsd.org
Subject:   Re: mv file with illegal character
Message-ID:  <20030422031507.GJ97289@doc.metva.com.au>
In-Reply-To: <20030422030823.GC28830@wantadilla.lemis.com>
References:  <20030421120037.P11148-100000@veager.jwweeks.com> <20030422030823.GC28830@wantadilla.lemis.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Apr 22, 2003 at 12:38:23PM +0930, Greg 'groggy' Lehey wrote:
|On Monday, 21 April 2003 at 12:09:15 -0400, Jim Weeks wrote:
|> This isn't a really a freebsd question, but I can't seem to find the answer
|> to this elsewhere.  I imagine that some of you may have come across the
|> same situation.
|>
|> One of my clients has renamed a directory -backup and now she can't do a
|> thing with it.  Any command seems to pickup the -b as an option rather
|> than part of the name.  I've tried *backup and still the illegal option
|> error occurs.
|>
|> Any ideas? 
|
|Strangely, nobody else answered this: use ./-backup.  . is the current
|directory, so ./filename is the same as filename for any value of
|"filename".

Perhaps no one answered becasue the man page also has the answer... I quote:

> The rm command uses getopt(3) to parse its arguments, which allows it to
> accept the `--' option which will cause it to stop processing flag
> options at that point.  This will allow the removal of file names that
> begin with a dash (`-').  For example:
> 	rm -- -filename
> The same behavior can be obtained by using an absolute or relative path
> reference.  For example:
> 	rm /home/user/-filename
> 	rm ./-filename


Cheers,

Enno.





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030422031507.GJ97289>