Hello Harry, * On Thu, Mar 18, 2010 at 05:48:12PM -0500 Harry Putnam wrote: > Spiro Trikaliotis <[email protected]> writes: > > >> The find command is flexible enough to do most of the work itself: > >> > >> $ find . -type d \( -name CVS -prune -o -print0 \) | xargs -0 -n 10 cvs > >> add -- > >> > >> and this variation should be safe regardless of what crazy characters > >> are present in filenames. > > > > Thank you! > > I like it but: > Now you've stepped away from readability a slight bit in my opinion.
This might be, but I am sure that the version with -print0 is "safer" than mimiking the same with the "tr \\n \\0" command. The latter tries to insert the null bytes after they have been generated. I am not completely sure if I did not overlook any case where we could already have an enter in a file name (is this possible on any platform)? > I think maybe the double grep -v is a bit more obvious. I know its not > really considered kosher by old unix hands... The double grep was especially needed as I was not completely sure how many backslashes I needed to quote, and I was too lazy to try out. ;) > I've used both -prune and -print0 but don't often find need of it. In > fact, only rarely. I use -print0 almost always with I pipe it through xargs (with -0), and I would advise to do so whenever possible. Best regards, Spiro. -- Spiro R. Trikaliotis http://opencbm.sf.net/ http://www.trikaliotis.net/ http://www.viceteam.org/
