Maybe I've already pointed this out; can't remember, so I'll do it now:

On Wed, Apr 04, 2001 at 09:23:37AM +0000, schmolle wrote:
> $ cd $WORKINGDIR
> $ find . \( -type d -name "CVS" -prune \) -o \( -type d -exec cvs add {} \; \) 
>2>/dev/null
> $ find . \( -type d -name "CVS" -prune \) -o \( -type f -exec cvs add {} \; \) 
>2>/dev/null
> 
> Advantage: This will (iirc) handle file names with spaces [...]

This is the only reason not to use xargs.  If you have GNU
findutils installed, though, you can use their xargs safely, as
follows:

    $ cd $WORKINGDIR
    $ find . \( -type d -name "CVS" -prune \) -o \( -type d -print0 \) | xargs -0 cvs 
add 2>/dev/null
    $ find . \( -type d -name "CVS" -prune \) -o \( -type f -print0 \) | xargs -0 cvs 
add 2>/dev/null

"find -print0" and "xargs -0" say to delimit the pathnames with
'\0' instead of '\n', and to take all other characters literally;
pathnames with funky characters are thus handled correctly.

> ps: I'm writing this code of the top of my head. TEST IT BEFORE YOU USE IT!

Likewise!

--

|  | /\
|-_|/  >   Eric Siegerman, Toronto, Ont.        [EMAIL PROTECTED]
|  |  /
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea.
        - RFC 1925 (quoting an unnamed source)

_______________________________________________
Info-cvs mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/info-cvs

Reply via email to