Re: Delete a specific type of files when they exist.

2009-01-10 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Hongyi Zhao on 1/10/2009 3:05 AM: >> $ touch a.cache-2 b.cache-2 >> $ echo [ -f *.cache-2 ] >> [ -f a.cache-2 b.cache-2 ] > > In your example, considering that the a.cache-2 and b.cache-2 have > been created by touch command, both the [ -

Re: Delete a specific type of files when they exist.

2009-01-10 Thread Hongyi Zhao
On Fri, 09 Jan 2009 07:36:26 -0700, Eric Blake wrote: >-BEGIN PGP SIGNED MESSAGE- >Hash: SHA1 > >According to Hongyi Zhao on 1/9/2009 6:38 AM: >> But I cann't figure this out, see the following results on my box: >> >> $ echo [ -f *.cache-2 ] >> [ -f *.cache-2 ] > >That means there aren'

Re: Delete a specific type of files when they exist.

2009-01-09 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Hongyi Zhao on 1/9/2009 6:38 AM: > But I cann't figure this out, see the following results on my box: > > $ echo [ -f *.cache-2 ] > [ -f *.cache-2 ] That means there aren't any *.cache-2 files in your directory. Next, try this: $ touch

Re: Delete a specific type of files when they exist.

2009-01-09 Thread Hongyi Zhao
On Fri, 09 Jan 2009 06:12:27 -0700, Eric Blake wrote: >-BEGIN PGP SIGNED MESSAGE- >Hash: SHA1 > >According to Hongyi Zhao on 1/8/2009 8:55 PM: >> 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 _[ -

Re: Delete a specific type of files when they exist.

2009-01-09 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Hongyi Zhao on 1/8/2009 8:55 PM: > 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?

Re: Delete a specific type of files when they exist.

2009-01-08 Thread Hongyi Zhao
On Fri, 9 Jan 2009 00:42:21 -0500, Christopher Faylor 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 se

Re: Delete a specific type of files when they exist.

2009-01-08 Thread Christopher Faylor
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 wildc

Re: Delete a specific type of files when they exist.

2009-01-08 Thread Hongyi Zhao
On Thu, 08 Jan 2009 22:01:26 -0600, "Yaakov (Cygwin/X)" wrote: >-BEGIN PGP SIGNED MESSAGE- >Hash: SHA256 > >Hongyi Zhao wrote: >> 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

Re: Delete a specific type of files when they exist.

2009-01-08 Thread Yaakov (Cygwin/X)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Hongyi Zhao wrote: > 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 wi

Delete a specific type of files when they exist.

2009-01-08 Thread Hongyi Zhao
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 th