Deleting files

Deleting files

Post by Sebastij » Tue, 31 Jul 2001 21:01:28



I have file "--n" in direktorij
(I create this file with tar: "tar cvfz --n xxx/*")

so, now I cannot delete this file.
if I type rm --n, the computer accept --n as parameter, not as filename..

FreeBSD 3.5-STABLE FreeBSD 3.5-STABLE #0: Thu Oct 26 15:25:59 CEST 2000

tx for help
sebastijan

 
 
 

Deleting files

Post by dbian.. » Tue, 31 Jul 2001 21:20:55



> if I type rm --n, the computer accept --n as parameter, not as filename..

Try rm -- --n
Davide

 
 
 

Deleting files

Post by Swif » Tue, 31 Jul 2001 21:59:55



Quote:>  I have file "--n" in direktorij
>  (I create this file with tar: "tar cvfz --n xxx/*")

>  so, now I cannot delete this file.
>  if I type rm --n, the computer accept --n as parameter, not as filename..

Try the autocompletion of your shell. It will probably generate something
like
        ~$ rm \-\-n
or
        ~$ rm "--n"

--
 SwifT                     -    Key-ID CDBA2FDB
 LUG: http://www.lugwv.be  -    http://www.keyserver.net

 
 
 

Deleting files

Post by Sebastian Han » Tue, 31 Jul 2001 22:29:54




> >  I have file "--n" in direktorij
> >  (I create this file with tar: "tar cvfz --n xxx/*")

> >  so, now I cannot delete this file.
> >  if I type rm --n, the computer accept --n as parameter, not as filename..

> Try the autocompletion of your shell. It will probably generate something
> like
>         ~$ rm \-\-n
> or
>         ~$ rm "--n"

The problem at hand is not a shell escape problem, it's rm interpreting
--n as an option.
As the other poster said, -- can be used to turn option processing off
for the rest of the commandline. Thus, "rm -- --n" should work.

seb
--

/ sebastian seb hans  \ www.crosswinds.net/~sebh /  attention this msg \
| student of comp sci  \ yes is no and no is ns /  will destroy itself |

 
 
 

Deleting files

Post by Lew Pitch » Tue, 31 Jul 2001 22:43:38


On Mon, 30 Jul 2001 15:29:54 +0200, Sebastian Hans




>> >  I have file "--n" in direktorij
>> >  (I create this file with tar: "tar cvfz --n xxx/*")

>> >  so, now I cannot delete this file.
>> >  if I type rm --n, the computer accept --n as parameter, not as filename..

>> Try the autocompletion of your shell. It will probably generate something
>> like
>>         ~$ rm \-\-n
>> or
>>         ~$ rm "--n"

>The problem at hand is not a shell escape problem, it's rm interpreting
>--n as an option.
>As the other poster said, -- can be used to turn option processing off
>for the rest of the commandline. Thus, "rm -- --n" should work.

As would
  rm ./--n
or
  rm /full/path/to/file/--n

Neither of these depend on GNU rm, and are portable across Unix and
Linux platforms (if that's important to anyone)

Lew Pitcher, Information Technology Consultant, Toronto Dominion Bank Financial Group

(Opinions expressed are my own, not my employer's.)

 
 
 

1. 'delete' command in ftp delete files in local hard disk ???

I write a batch file in Windows to download some files from an
UltraSPARC running Solaris in a LAN. The files will be deleted after
it was retrieved. Currently, I generate a ftp script file in the batch
file and pass it to ftp with 'ftp -ivn < myfile.ftp' in Windows.

The ftp script generated will be something like this:

open <ip_address>
user <username> <pass>
cd <source_path>
lcd <dest_path>
get myfile1
delete myfile1
get myfile2
delete myfile2
...
..
bye

Note that It is possible that the files are not available in the
UltraSPARC and it seems there is a bug in the ftp 'delete' command
(maybe in Windows environment).

The 'delete' command is supposed to delete the file in the REMOTE
environment, however, if the file does not exist in the UltraSPARC,
the 'delete' command will delete the file store in my LOCAL HARD DISK.

Is there anyway to prevent the 'delete' command to delete the files in
my local hard disk when it doesn't exist in thre UltraSPARC ?

\/\/yatt \/\/ong Home Page - http://www.asiaonline.net.hk/~tfwong/
Winona Ryder Forever H. P. - http://www.asiaonline.net.hk/~tfwong/winona/

Send a message with subject GET PGP KEY to get my PGP public key

2. KSR[T] Advisory #7: filter

3. recover deleted file in hp-ux ( vxfs file system)

4. Upgrading Kernels - compatiblity?

5. Deleting Files Without Worrying about : Overriding Protection Of Your File

6. Solution re: rcmd: Socket : Permission denied

7. How do I delete files w/control char embedded in file name?

8. 0.99.12 mounts all partitions as read-only. How do i fix it?

9. "rm: can't unlink 'files'",can't delete files

10. Deleting file named "-file"

11. HELP! Can't delete file!

12. deleting files containing text

13. How does rdist cope with dirs when you delete files in them?