An invocation of xargs such as echo $(seq 1 100) | ./toybox-x86_64 xargs -n1 sh -c 'sleep "$0"; echo "$0"; exit 255' results in the following:
$ echo $(seq 1 6) | ./toybox-x86_64 xargs -n1 sh -c 'sleep "$0"; echo "$0"; exit 255'
1
xargs: sh: exited with status 255; aborting
2
xargs: sh: exited with status 255; aborting
3
xargs: sh: exited with status 255; aborting
4
xargs: sh: exited with status 255; aborting
5
xargs: sh: exited with status 255; aborting
6
xargs: sh: exited with status 255; aborting
$ echo $?
124
$
even though the POSIX standard states that:
If [...] an invocation of the utility exits with exit status 255, the xargs utility shall write a diagnostic message and exit without processing any remaining input.
...meaning that Toybox should have exited after printing the first diagnostic, without processing the rest of the input.
An invocation of
xargs
such asecho $(seq 1 100) | ./toybox-x86_64 xargs -n1 sh -c 'sleep "$0"; echo "$0"; exit 255'
results in the following:even though the POSIX standard states that:
...meaning that Toybox should have exited after printing the first diagnostic, without processing the rest of the input.