From owner-freebsd-questions@FreeBSD.ORG Sat Mar 31 22:01:40 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7949216A405 for ; Sat, 31 Mar 2007 22:01:40 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from mxout1.cac.washington.edu (mxout1.cac.washington.edu [140.142.32.134]) by mx1.freebsd.org (Postfix) with ESMTP id 54BB513C459 for ; Sat, 31 Mar 2007 22:01:40 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from smtp.washington.edu (smtp.washington.edu [140.142.32.141] (may be forged)) by mxout1.cac.washington.edu (8.13.7+UW06.06/8.13.7+UW07.03) with ESMTP id l2VM1djA029936 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 31 Mar 2007 15:01:39 -0700 X-Auth-Received: from [192.168.10.7] (c-67-187-172-183.hsd1.ca.comcast.net [67.187.172.183]) (authenticated authid=youshi10) by smtp.washington.edu (8.13.7+UW06.06/8.13.7+UW07.03) with ESMTP id l2VM1d2Z003302 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sat, 31 Mar 2007 15:01:39 -0700 Message-ID: <460EE81D.3080009@u.washington.edu> Date: Sat, 31 Mar 2007 15:00:45 -0800 From: Garrett Cooper User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: freebsd-questions@freebsd.org References: <1794.212.25.54.147.1175369763.squirrel@mail.uni-svishtov.bg> <6.0.0.22.2.20070331151239.02578380@mail.computinginnovations.com> <460EE543.5080104@u.washington.edu> In-Reply-To: <460EE543.5080104@u.washington.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Version: 5.3.0.289146, Antispam-Engine: 2.5.0.283055, Antispam-Data: 2007.3.31.145333 X-Uwash-Spam: Gauge=IIIIIII, Probability=7%, Report='__CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __USER_AGENT 0' Subject: Re: deleting file '--preserve-permissions' X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Mar 2007 22:01:40 -0000 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