Re: deleting file '--preserve-permissions'

2007-04-01 Thread Bernd Trippel
The fingers of Garrett Cooper typed on 01/04/07 01:00:
 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, [EMAIL PROTECTED] 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
 [EMAIL PROTECTED]
 

You should always be able to delete files per inode, which is quite
handy with files containing special characters.

ls -i *
2324367 foo
find . -inum 2324367 -exec rm {} \;

Saves me a lot of hassle.



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


deleting file '--preserve-permissions'

2007-03-31 Thread lalev
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 :-)

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: deleting file '--preserve-permissions'

2007-03-31 Thread Erik Trulsson
On Sat, Mar 31, 2007 at 10:36:03PM +0300, [EMAIL PROTECTED] 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 :-)

You should read the rm(1) man-page.
Especially the part that says:


  NOTE
   The rm command uses getopt(3) to parse its arguments, which allows it to
   accept the --' option which will cause it to stop processing flag
   options at that point.  This will allow the removal of file names that
   begin with a dash (-').  For example:
 rm -- -filename
   The same behavior can be obtained by using an absolute or relative path
   reference.  For example:
 rm /home/user/-filename
 rm ./-filename




-- 
Insert your favourite quote here.
Erik Trulsson
[EMAIL PROTECTED]
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: deleting file '--preserve-permissions'

2007-03-31 Thread Derek Ragona

try:
rm -i *

only answer y to the one you want deleted.

-Derek


At 02:36 PM 3/31/2007, [EMAIL PROTECTED] 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 :-)

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: deleting file '--preserve-permissions'

2007-03-31 Thread Garrett Cooper

Derek Ragona wrote:

try:
rm -i *

only answer y to the one you want deleted.

-Derek


At 02:36 PM 3/31/2007, [EMAIL PROTECTED] 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
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: deleting file '--preserve-permissions'

2007-03-31 Thread Garrett Cooper

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, [EMAIL PROTECTED] 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 [EMAIL PROTECTED]