SUMMARY: Cannot delete a file called "-c"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Scott and all

I posted in a list a query pretty similar than your one, and although it
was related to Solaris 8, I was using bash, and I supose that the behavior
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ÑADIDO/TSM con fecha 31/03/2004
08:48 ---------------------------


Pedro Angel Garcia Benavente
25/03/2004 16:27

Destinatarios:    sunmanagers@xxxxxxxxxxxxxxx
CC:         Pedro Angel Garcia Benavente/UT03422/DES. SERVICIOS DE VALOR
            AÑADIDO/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 <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 AÑADIDO/TSM con fecha 25/03/2004
15:25 ---------------------------

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

Destinatarios:    sunmanagers@xxxxxxxxxxxxxxx
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.


---------------------- Remitido por Pedro Angel Garcia
Benavente/UT03422/DES. SERVICIOS DE VALOR AÑADIDO/TSM con fecha 31/03/2004
08:48 ---------------------------


Pedro Angel Garcia Benavente
25/03/2004 16:55

Destinatarios:    sunmanagers@xxxxxxxxxxxxxxx
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 works
.- #find . -type f -name '-c' -exec rm {} \;  It happens the same that I
said in the summary, the output of find is "incomplete statement"

Thanks you,
      Pedro.





-
: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Newbie]     [Audio]     [Hams]     [Kernel Newbies]     [Util Linux NG]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Device Drivers]     [Samba]     [Video 4 Linux]     [Git]     [Fedora Users]

  Powered by Linux