info-cvs
[Top][All Lists]
Advanced

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

RE: [Fwd: Re: Rename directory]


From: Matt Doar
Subject: RE: [Fwd: Re: Rename directory]
Date: Mon, 12 Dec 2005 11:21:58 -0800

find and xargs actually works fine with files and directories with
spaces in them. 
You just have to use find -print0 | xargs -0 

~Matt

-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf
Of Todd Denniston
Sent: Monday, December 12, 2005 6:54 AM
To: Jim Hyslop
Cc: address@hidden
Subject: Re: [Fwd: Re: Rename directory]

Jim Hyslop wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> (I think this was intended for the list)
> 
> - -------- Original Message --------
> Subject: Re: Rename directory
> Date: Fri, 09 Dec 2005 09:39:41 -0800
> From: Ted Stern <address@hidden>
> 
> On  8 Dec 2005 at 18:14 UTC-0800, Jim Hyslop wrote:
> 
>>>Also a side question, is there a way to recursively add files and
>>>directories under a directory with one command - something like cvs
>>>-R add 15_coolest_things/ ?
>>
>>No, the closest you can get is 'cvs import'. Either that, or the
'find'
>>command, with '-exec cvs add {}'
> 
> 
> Most of the time, find's -exec option is slow and cumbersome.  

However the user should be aware of one place where the exec works
better than 
xargs.
If someone has been allowed to put space(s) in file names or directory
names, 
xargs will fail for those entries, where -exec would work.

The wisdom of allowing spaces in file names or directory names has
already 
been discussed, check the list archive if you want to see that flame
fest. (of 
which I was a part.)

> Use
> find with the -print, then pass the results to xargs to run the
> command on a bunch of things at once.  For example:
> 
>      find <dirname> -print | xargs cvs add
> 
> If your find command doesn't print the directories before the files,
> add the directories first.
> 
>      find <dirname> -type d -print | xargs cvs add
>      find <dirname> -type f -print | xargs cvs add
> 
> Ted
> - --
>  dodecatheon at gmail dot com
>  Frango ut patefaciam -- I break so that I may reveal
> 
> 
> - --
> Jim Hyslop
> Dreampossible: Better software. Simply.
http://www.dreampossible.ca
>                  Consulting * Mentoring * Training in
>     C/C++ * OOD * SW Development & Practices * Version Management
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2 (MingW32)
> Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
> 
> iD8DBQFDmm64LdDyDwyJw+MRArKAAJ0Qp9xyQNgEMkOXIQL/v2oD3C0SXgCg9ENK
> 3ejbAhyox6qpw59P6+7RaMc=
> =0fMw
> -----END PGP SIGNATURE-----
> 
> 
> 
> _______________________________________________
> Info-cvs mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/info-cvs
> 



_______________________________________________
Info-cvs mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/info-cvs




reply via email to

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