xargs exit status
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
findutils (Ubuntu) |
Fix Released
|
Medium
|
Unassigned |
Bug Description
i386 up-to-date 5.10 Breasy Ubuntu, findutils 4.2.22-2
The xargs command is not returning the correct exit status if a sub-process has
a non-zero exit status.
Example...
$ false
echo $?
1
$ echo hello | xargs false
echo $?
0
$
This contradicts the man page...
"EXIT STATUS
xargs exits with the following status:
0 if it succeeds
123 if any invocation of the command exited with status 1-125
124 if the command exited with status 255
125 if the command is killed by a signal
126 if the command cannot be run
127 if the command is not found
1 if some other error occurred."
Thus, the false example above should have given an exit status of 123.
Seems to be behaving correctly in current Dapper:
mizar:[~] echo hello | xargs false
zsh: done echo hello |
zsh: exit 123 xargs false
mizar:[~] echo $?
123
Please reopen if you find otherwise.