From owner-freebsd-bugs@FreeBSD.ORG Sun Apr 26 14:50:03 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 826DB106566B for ; Sun, 26 Apr 2009 14:50:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 55F088FC0A for ; Sun, 26 Apr 2009 14:50:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n3QEo30G020637 for ; Sun, 26 Apr 2009 14:50:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n3QEo3w0020632; Sun, 26 Apr 2009 14:50:03 GMT (envelope-from gnats) Date: Sun, 26 Apr 2009 14:50:03 GMT Message-Id: <200904261450.n3QEo3w0020632@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Jilles Tjoelker Cc: Subject: Re: bin/124748: [patch] sh(1): sh -c 'exit -1' fails with "Illegal number: -1", instead of exiting with a code of 255 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Jilles Tjoelker List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2009 14:50:03 -0000 The following reply was made to PR bin/124748; it has been noted by GNATS. From: Jilles Tjoelker To: bug-followup@FreeBSD.org, gcooper@FreeBSD.org Cc: Subject: Re: bin/124748: [patch] sh(1): sh -c 'exit -1' fails with "Illegal number: -1", instead of exiting with a code of 255 Date: Sun, 26 Apr 2009 16:40:46 +0200 Do people actually use 'exit -1' instead of the clearer 'exit 255'? '-1' is not an unsigned integer, so not a posix compliant parameter to the exit special builtin. Even then, sh still aborts a script with a nonzero exit code if exit is used wrongly like this. -- Jilles Tjoelker