[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-questions
Subject:    Re: deleting file '--preserve-permissions'
From:       Garrett Cooper <youshi10 () u ! washington ! edu>
Date:       2007-03-31 22:11:00
Message-ID: 460EE81D.3080009 () u ! washington ! edu
[Download RAW message or body]

Garrett Cooper wrote:
> Derek Ragona wrote:
>> try:
>> rm -i *
>>
>> only answer y to the one you want deleted.
>>
>>         -Derek
>>
>>
>> At 02:36 PM 3/31/2007, lalev@uni-svishtov.bg wrote:
>>> I've made mistake with tar. Something like
>>>
>>> tar cvfz --preserve-permissions home.tgz *
>>>
>>> or
>>>
>>> tar cvfz --preserve-permissions * home.tgz
>>>
>>> As result I have a file with name '--preserve-permissions'.
>>> It seems that it's not easy to delete this file.
>>>
>>> rm '--preserve-permissions'
>>>
>>> does not give the desired result.
>>> What should I do :-)
> rm -- '--perserve-permissions'. -- tells getopt to stop searching and 
> the single quotes are a double bonus because it doesn't interpret the 
> string contents beforehand, but instead passes it on as a straight 
> string.
>
> Try: rm "--perserve-permissions" and rm '--perserve-permissions', in 
> that order to just see what happens ;)..
>
> -Garrett
Haha. Forgot that the single quotes version won't work by itself. It's 
basically for cases when there are shell sensitive characters inside a 
string, when compared to the double quotes. The first solution with -- 
will work though, guaranteed :).

-Garrett
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic