[comp.sys.amiga.tech] Unix & options

mwm@raven.pa.dec.com (Mike (Under Construction) Meyer) (01/23/90)

To give a well-known solution to a common problem:

>> Under most UNIX commands, this is impossible even if you quote it.
>> For example, try removing a file named "-rf" from your home directory
>> under UNIX.

rm ~/-rf
rm ./-rf
rm -i *			# maybe - depends on what else is in the directory

	<mike
--
Il brilgue: les toves lubricilleux			Mike Meyer
Se gyrent en vrillant dans le guave,			mwm@berkeley.edu
Enmimes sont les gougebosqueux,				ucbvax!mwm
Et le momerade horsgrave.				mwm@ucbjade.BITNET

lynn@phx.mcd.mot.com (Lynn D. Newton) (01/23/90)

> To give a well-known solution to a common problem:
> 
> >> Under most UNIX commands, this is impossible even if you quote it.
> >> For example, try removing a file named "-rf" from your home directory
> >> under UNIX.
> 
> rm ~/-rf
> rm ./-rf
> rm -i *			# maybe - depends on what else is in the directory

Here's the UNIX solution I use for that problem:

$ ls -CabF
-rf		./             ../            master.wires
$ find . -name "\-??" -exec rm -i {} \;
or else
$ find . -name "\-??" -ok rm {} \;

Works great!

--
=================================================================
Lynn D. Newton            | System Test
Motorola MCD, Tempe, AZ   | (Department of Heuristic Neology)
(602) 437-3739            | "The bug stops here!"
lynn@jazz.phx.mcd.mot.com |