On Tue, Jun 28, 2005 at 12:04:47PM -0400, J. Milgram wrote:
> sh -c ... xargs ...
>
> Thanks everyone.
> Amazing, something that "find" can't do.
Lies! Find can do everything!
Find under solaris can do this natively: just replace the \; with a \+
% /bin/find . -type f -exec echo {} \+ | wc -l
1
(yes, this feature is undocumented)
you can do it this way, but it's less efficient b/c you are calling
find n times instead of once (where n is the number of files).
% find . -type f -exec grep {} /dev/null \; | cut -d: -f1
This works b/c grep will print the file name when you give it multiple
files on the command line, and the file /dev/null will never match any
patern you give it. The 'cut' just extracts the file name.
Just rambling... sorry.
- Rob
.