delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/01/09/02:34:23

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=2.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_64,RCVD_IN_CHINA,RCVD_IN_DNSWL_LOW,RCVD_NUMERIC_HELO,SPF_HELO_PASS,SPF_PASS
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Hongyi Zhao <hongyi DOT zhao AT gmail DOT com>
Subject: Re: Delete a specific type of files when they exist.
Date: Fri, 09 Jan 2009 15:33:52 +0800
Lines: 23
Message-ID: <aevdm4lj7gqq2er6r42eeeoqr5mo3ok0a5@4ax.com>
References: <rfidm4hfs5p9h6s40obf5s083onsau7j26 AT 4ax DOT com> <20090109054221 DOT GA28337 AT ednor DOT casa DOT cgf DOT cx>
Mime-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Fri, 9 Jan 2009 00:42:21 -0500, Christopher Faylor
<cgf-use-the-mailinglist-please AT cygwin DOT com> wrote:

>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

A good idea.  Thanks.

-- 
.: Hongyi Zhao [ hongyi.zhao AT gmail.com ] Free as in Freedom :.


--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019