SUMMARY: Cannot delete a file called "-c"

From: <garcia_pan_at_tsm.es>
Date: Thu Mar 25 2004 - 10:27:55 EST
Hi all

A lot of answers indeed: about 50, thanks you all

All this works. The general idea is to say to rm that "-c" is NOT a
parameter.

#rm ./-c
#rm - -c
#rm -- -c
#touch <anyname>;rm <anyname> -c

These one also works

#perl -e 'unlink ("-c");'
#/usr/bin/unlink -c

These one doesn't works, i have no time now to investigate why, but I think
that all of them are not properly "isolating" -c as filename rather that as
parameter.

#rm ?c
#rm *c
#rm -i
.- Using ls -i to obtain inode number and then use find to locate and
delete the file doesn't work: find gets "stalled" or says "incomplete
statement"
.- All of those based on "xargs rm" (either using find or using ls + grep +
cut) considers "-c" as an argument

Well, thanks you again, and have a nice day
      Pedro


---------------------- Remitido por Pedro Angel Garcia
Benavente/UT03422/DES. SERVICIOS DE VALOR AQADIDO/TSM con fecha 25/03/2004
15:25 ---------------------------

25/03/2004 15:13
Pedro Angel Garcia Benavente
DES. SERVICIOS DE VALOR AQADIDO

Destinatarios:    sunmanagers@sunmanagers.org
CC:
Asunto:     Cannot delete a file called "-c"

Hi all.

Looking for files to be deleted in a netra X1 with Solaris 8, I found a
file called "-c".

I have tied to delete it using rm "-c", rm '-c', rm \-c....  and eveytime
the output is "illegal option: -c"

Could someone please say how to delete this file?

TIA

Pedro.
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Thu Mar 25 10:35:12 2004

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:30 EST