SUMMARY: Cannot delete a file called "-c"
am 31.03.2004 08:56:54 von garcia_panHi Scott and all
I posted in a list a query pretty similar than your one, and although i=
t
was related to Solaris 8, I was using bash, and I supose that the behav=
ior
of bash is the same in both of the OS.
Attached please find the summaries I did for that list.
HTH
Best regards,
Pedro.
---------------------- Remitido por Pedro Angel Garcia
Benavente/UT03422/DES. SERVICIOS DE VALOR A=D1ADIDO/TSM con fecha 31/03=
/2004
08:48 ---------------------------
Pedro Angel Garcia Benavente
25/03/2004 16:27
Destinatarios: sunmanagers@sunmanagers.org
CC: Pedro Angel Garcia Benavente/UT03422/DES. SERVICIOS DE VALO=
R
A=D1ADIDO/TSM@TSM
Asunto: SUMMARY: Cannot delete a file called "-c"
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
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 t=
hink
that all of them are not properly "isolating" -c as filename rather tha=
t 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 A=D1ADIDO/TSM con fecha 25/03=
/2004
15:25 ---------------------------
25/03/2004 15:13
Pedro Angel Garcia Benavente
DES. SERVICIOS DE VALOR A=D1ADIDO
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 eveyti=
me
the output is "illegal option: -c"
Could someone please say how to delete this file?
TIA
Pedro.
---------------------- Remitido por Pedro Angel Garcia
Benavente/UT03422/DES. SERVICIOS DE VALOR A=D1ADIDO/TSM con fecha 31/03=
/2004
08:48 ---------------------------
Pedro Angel Garcia Benavente
25/03/2004 16:55
Destinatarios: sunmanagers@sunmanagers.org
CC:
Asunto: SUMMARY_2: Cannot delete a file called "-c" (Document link=
:
Sun managers)
Two more options:
- ftp to the machine and then delete or even rename the file: it wor=
ks
- #find . -type f -name '-c' -exec rm {} \; It happens the same tha=
t I
said in the summary, the output of find is "incomplete statement"
Thanks you,
Pedro.
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" =
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html