Delete a specific type of files when they exist.

Christopher Faylor cgf-use-the-mailinglist-please@cygwin.com
Fri Jan 9 09:31:00 GMT 2009


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/



More information about the Cygwin mailing list