After reading your comment
The input may be coming from a file,
If the list of files is already on file you have, you can just skip the find part and use just the
xargs man page.
-a option of
xargs to pass the filename of the file where is the list that
xargs has to read.
If the filenames inside the list is not a full filename and just passing this to
wc is not enough because there is no directory you can edit the file, so that the full path is included (you should be able to do that without manually edit it, by using
awk or similar).
Or you can use the replace string mechanism in
-I option in
(note that if you use this last method, with
-I replacement, each line will invoke a different program and that there are some limitations on the maximum length - see man page for details)
If your input is coming from a file (and hence you can not use the mechanism provided by the
-0 option of
xargs), you have to pay great attention if there are space or other strange characters in the filename. If there are you should find a way to avoid some unexpected result.
For example if you have a file named "my document.txt"
and in your list is written as
and then it is passed like it is written in the file, you would get that what it is executed is
wc my document.txt
and this would result in
wc program looking for two files, one named my and one named document.txt
You should be sure that what is passed is something like
wc "my document.txt"
wc my\ document.txt
(The first way may be easier if you are already using the replace mechanism, the second one if you are already editing your file.)
Well, if you can, maybe is just easier to edit the input file so that each item is separated by a null character and use the
-0 option of