[Bug 11381] Wrong exit code in xargs
bugzilla at busybox.net
bugzilla at busybox.net
Fri Oct 5 12:54:42 UTC 2018
https://bugs.busybox.net/show_bug.cgi?id=11381
--- Comment #1 from Masar <masar at masarlabs.com> ---
Here is a sample command that shows the problem:
echo "1 2 3" | busybox xargs -n 1 -I '{}' sh -c "exit 255" ; echo $?
This command shoud print '124' as exit code, but in newer versions it returns
'0'
I tested on varioius linux systems and with docker:
1.29: ERROR
1.28: ERROR
1.27: OK
1.26: OK
DOCKER: latest
docker run -ti --rm busybox:latest
/ # echo 1 2 3 | /bin/busybox xargs -n 1 -I '{}' sh -c 'exit 255' ; echo $?
xargs: sh: exited with status 255; aborting
0
DOCKER: 1.29
docker run -ti --rm busybox:1.29
/ # echo 1 2 3 | /bin/busybox xargs -n 1 -I '{}' sh -c 'exit 255' ; echo $?
xargs: sh: exited with status 255; aborting
0
DOCKER: 1.28
docker run -ti --rm busybox:1.28
/ # echo 1 2 3 | /bin/busybox xargs -n 1 -I '{}' sh -c 'exit 255' ; echo $?
xargs: sh: exited with status 255; aborting
0
DOCKER: 1.27
docker run -ti --rm busybox:1.27
/ # echo 1 2 3 | /bin/busybox xargs -n 1 -I '{}' sh -c 'exit 255' ; echo $?
xargs: sh: exited with status 255; aborting
124
DOCKER: 1.26
docker run -ti --rm busybox:1.26
/ # echo 1 2 3 | /bin/busybox xargs -n 1 -I '{}' sh -c 'exit 255' ; echo $?
xargs: sh: exited with status 255; aborting
124
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the busybox-cvs
mailing list