From owner-freebsd-bugs@FreeBSD.ORG Sat Apr 7 03:20:03 2007 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2AB6516A408 for ; Sat, 7 Apr 2007 03:20:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id E8F0E13C45A for ; Sat, 7 Apr 2007 03:20:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l373K25r050211 for ; Sat, 7 Apr 2007 03:20:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l373K2uS050210; Sat, 7 Apr 2007 03:20:02 GMT (envelope-from gnats) Resent-Date: Sat, 7 Apr 2007 03:20:02 GMT Resent-Message-Id: <200704070320.l373K2uS050210@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Alexander Melkov Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5C7A716A403 for ; Sat, 7 Apr 2007 03:16:12 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [69.147.83.33]) by mx1.freebsd.org (Postfix) with ESMTP id 4EC1D13C48C for ; Sat, 7 Apr 2007 03:16:12 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l373GBuR010184 for ; Sat, 7 Apr 2007 03:16:11 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id l373BAaL000574; Sat, 7 Apr 2007 03:11:10 GMT (envelope-from nobody) Message-Id: <200704070311.l373BAaL000574@www.freebsd.org> Date: Sat, 7 Apr 2007 03:11:10 GMT From: Alexander Melkov To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.0 Cc: Subject: bin/111343: sh and bash with -e sometimes fail to test errors in functions X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Apr 2007 03:20:03 -0000 >Number: 111343 >Category: bin >Synopsis: sh and bash with -e sometimes fail to test errors in functions >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Apr 07 03:20:02 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Alexander Melkov >Release: 6.2 >Organization: >Environment: FreeBSD melkov.ru 6.2-PRERELEASE FreeBSD 6.2-PRERELEASE #9: Thu Jan 11 23:13:53 MSK 2007 ----@melkov.ru:/usr/obj/usr/src/sys/MELKOV i386 >Description: When shell function is called as a part of complex command with || operator, effect of -e (i.e. exit after first untested command returns error status) within that function is disabled. >How-To-Repeat: 1. Create script ==> test.sh <== set -e qq ( ) { false echo ok } qq || echo failed 2a) FreeBSD 4.11 Command: sh -e test.sh Command: bash -e test.sh Output: ok 2b) FreeBSD 6.2 Command: sh -e test.sh Output: ok Command: bash -e test.sh Output: ok In all cases, expected output is: failed >Fix: >Release-Note: >Audit-Trail: >Unformatted: