[bug #68501] Manual unclear about exit codes 128 through 254

Victor Engmark <[email protected]> Sun, 5 Jul 2026 08:18:05 -0400 (EDT)
Newsgroups gmane.comp.gnu.findutils.bugs
Message-ID <[email protected]>
--8323329-1714636915-1783253885=:3945620
Content-Type: TEXT/plain; CHARSET=utf-8
Content-Transfer-Encoding: QUOTED-PRINTABLE
Content-Disposition: inline

URL:=0A  <https://savannah.gnu.org/bugs/?68501>=0A=0A                 Summa=
ry: Manual unclear about exit codes 128 through 254=0A                   Gr=
oup: findutils=0A               Submitter: l0b0=0A               Submitted:=
 Sun 05 Jul 2026 02:18:01 PM CEST=0A                Category: xargs=0A     =
           Severity: 3 - Normal=0A                Priority: 5 - Normal=0A  =
            Item Group: Wrong result=0A                  Status: None=0A   =
              Privacy: Public=0A             Assigned to: None=0A         O=
riginator Name:=0A        Originator Email:=0A             Open/Closed: Ope=
n=0A         Discussion Lock: Unlocked=0A                 Release: 4.10.0=
=0A           Fixed Release: None=0A=0A=0A    _____________________________=
__________________________=0A=0AFollow-up Comments:=0A=0A=0A---------------=
----------------------------------------=0ADate: Sun 05 Jul 2026 02:18:01 P=
M CEST By: Victor Engmark <l0b0>=0AThe relevant part of `man xargs`:=0A=0A`=
``man=0AEXIT STATUS=0A     xargs exits with the following status:=0A=0A    =
        0      if it succeeds=0A=0A            123    if any invocation of =
the command exited with status=0A1=E2=80=93125=0A=0A            124    if t=
he command exited with status 255=0A=0A            125    if the command is=
 killed by a signal=0A=0A            126    if the command cannot be run=0A=
=0A            127    if the command is not found=0A=0A            1      i=
f some other error occurred.=0A=0A     Exit  codes greater than 128 are use=
d by the shell to indicate that a=0Apro=E2=80=90=0A     gram died due to a =
fatal signal.=0A```=0A=0ADespite the last paragraph, there's nothing stoppi=
ng a script from running=0A`exit 128` or higher to achieve the same result =
as receiving a fatal signal.=0ABut the manual snippet above doesn't indicat=
e what xargs returns when the exit=0Acode of the command is 128 through 254=
. I guessed from the last paragraph that=0Ait would return the original exi=
t code of the first/last failing command, but=0Athat is not the case:=0A=0A=
```console=0A$ echo 126 | xargs -I{} bash -c 'exit {}'; echo $?=0A123=0A$ e=
cho 127 | xargs -I{} bash -c 'exit {}'; echo $?=0A123=0A$ echo 128 | xargs =
-I{} bash -c 'exit {}'; echo $?=0A123=0A$ echo 254 | xargs -I{} bash -c 'ex=
it {}'; echo $?=0A123=0A```=0A=0ASo it looks like the note for exit code 12=
3 should be amended to say "1-254"=0Arather than "1-125". The final paragra=
ph about fatal signals can probably be=0Aremoved.=0A=0AVersion:=0A=0A```con=
sole=0A$ xargs --version=0Axargs (GNU findutils) 4.10.0=0ACopyright (C) 202=
4 Free Software Foundation, Inc.=0ALicense GPLv3+: GNU GPL version 3 or lat=
er=0A<https://gnu.org/licenses/gpl.html>.=0AThis is free software: you are =
free to change and redistribute it.=0AThere is NO WARRANTY, to the extent p=
ermitted by law.=0A=0AWritten by Eric B. Decker, James Youngman, and Kevin =
Dalley.=0A```=0A=0A=0A=0A=0A=0A=0A=0A    __________________________________=
_____________________=0A=0AReply to this item at:=0A=0A  <https://savannah.=
gnu.org/bugs/?68501>=0A=0A_______________________________________________=
=0AMessage sent via Savannah=0Ahttps://savannah.gnu.org/=0A
--8323329-1714636915-1783253885=:3945620
Content-Type: APPLICATION/pgp-signature; name=signature.asc

-----BEGIN PGP SIGNATURE-----

iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCakpLfQAKCRCqLAuaBUf3
TofBAQDsX1Asq5nui/pxSn4LALHYIS9jHsMHCk/egib5nKuzUgEAtalYgNQQOCRw
sJ4T7tQCqZf9O9CndNfOk5LswLX+5w8=
=WQnR
-----END PGP SIGNATURE-----

--8323329-1714636915-1783253885=:3945620--