X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Date: Fri, 9 Jan 2009 00:42:21 -0500
From: Christopher Faylor <cgf-use-the-mailinglist-please@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Delete a specific type of files when they exist.
Message-ID: <20090109054221.GA28337@ednor.casa.cgf.cx>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <rfidm4hfs5p9h6s40obf5s083onsau7j26@4ax.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <rfidm4hfs5p9h6s40obf5s083onsau7j26@4ax.com>
User-Agent: Mutt/1.5.16 (2007-06-09)
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Note-from-DJ: This may be spam

On Fri, Jan 09, 2009 at 11:55:46AM +0800, Hongyi Zhao wrote:
>Hi all,
>
>I want to delete the all of the cache-2 files under a directory, so I
>use the following line to do this:
>
>if [ -f *.cache-2 ] rm *.cache-2
>
>But it seems that this -f parameter in the _if_ command will not work
>with wildcard, i.e., the  _[ -f *.cache-2 ]_ isn't a valid arg.  Any
>hints on this issue? 

Why not just

  rm -f *.cache-2

?

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

