xargs does not always handle its arguments correctly.
Please find attached to the bug, the follwing files:
* in
* sedscript
* echo_args
As will be seen, the sedscript reads the file named "in", takes
each character and precedes it with a backslash, then feeds it
onto xargs which prints each of the arguments it's given to the
file out. At the end, the files "in" and "out" should be identical.
For a small enough "in" file they are, but for the file "in"
attached (6623 characters), they are not.
Here's the output of "diff in out"
39c39,44
< are found in <filename>/dev/dsk</filename>; the names of the raw files are
---
> are
> found
> in
> <filename>/dev/dsk</filename>;
> the
> names of the raw files are
If the gnu version of xargs (from the sunfreeware site) is used,
the files "in" and "out" are identical.
The same behaviour is observed with Solars 2.6, 7, 8, 9 and
10_70.
Work Around
Use the '-n' argument with a small value, which reduces the likelihood
that the maximum arglist length will be reached. To guarantee that the
bug won't appear, use a '-n' value of 1. This severely reduces the
efficiency of xargs, however, by causing it to exec the target command
more frequently.
Alternatively, use GNU xargs instead (/opt/sfw/bin/gxargs).
xxxxx@xxxxx.com 2005-1-07 17:20:40 GMT