bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: rm -r bug in version 4.1, Cygwin on Win2k


From: Paul Jarc
Subject: Re: rm -r bug in version 4.1, Cygwin on Win2k
Date: Fri, 28 Dec 2001 11:37:15 -0500
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/20.7 (i386-redhat-linux-gnu)

"Adam MacBeth" <address@hidden> wrote:
> I can't make "rm -r" work with Cygwin on Win2K.  When running "rm -r *.obj"
> in a directory without .obj files, I get:
>
> rm: cannot remove `*.obj': No such file or directory
>
> The subdirectories all have .obj files in them, but none of them are
> removed.

You're confused about "*".  Unlike with Windows/DOS, wildcards are
expanded by the shell.  Programs like rm then just operate on the
resulting names; they never see the wildcards.  In a case like this
where there are no files matching the wildcard, it is given to the
program unmodified, but the program still treats it as a plain
filename.

This will do what you want:
find . -name '*.obj' -exec rm '{}' ';'

The "find" command will look through the directory tree for files
matching the given criteria and apply the given action to those files.


paul



reply via email to

[Prev in Thread] Current Thread [Next in Thread]