From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27965 invoked by alias); 24 May 2017 12:54:34 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 27748 invoked by uid 89); 24 May 2017 12:54:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=BAYES_50,GIT_PATCH_2,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=russia, Russia, Samsung, HContent-transfer-encoding:7bit X-HELO: mailout3.w1.samsung.com Received: from mailout3.w1.samsung.com (HELO mailout3.w1.samsung.com) (210.118.77.13) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 24 May 2017 12:54:31 +0000 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OQG00CFJJUUEF90@mailout3.w1.samsung.com> for cygwin@cygwin.com; Wed, 24 May 2017 13:54:30 +0100 (BST) Received: from eusmges1.samsung.com (unknown [203.254.199.239]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170524125430eucas1p234e2c9e18f6c731be60930a76746cb2c~Bi-0TqKni2239922399eucas1p2G for ; Wed, 24 May 2017 12:54:30 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1.samsung.com (EUCPMTA) with SMTP id E6.DB.14140.88285295; Wed, 24 May 2017 13:54:32 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170524125429eucas1p1384ad5e0c60eb4974a0f57e0f0203d9a~Bi-zpp1SJ0268402684eucas1p12 for ; Wed, 24 May 2017 12:54:29 +0000 (GMT) Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 8F.97.20206.58285295; Wed, 24 May 2017 13:54:29 +0100 (BST) Received: from fedinw7x64 ([106.109.131.169]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OQG00KG3JUSL1A0@eusync3.samsung.com> for cygwin@cygwin.com; Wed, 24 May 2017 13:54:29 +0100 (BST) From: Pavel Fedin To: cygwin@cygwin.com Subject: Bug: bash -e misbehaves with several nested Date: Wed, 24 May 2017 15:55:00 -0000 Message-id: <000e01d2d48c$e16d1ca0$a44755e0$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170524125429eucas1p1384ad5e0c60eb4974a0f57e0f0203d9a X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?UTF-8?B?UGF2ZWwgRmVkaW4bU1JSLVBsYXRmb3JtIExhYhvsgrzshLE=?= =?UTF-8?B?7KCE7J6QG1NlbmlvciBFbmdpbmVlcg==?= X-Global-Sender: =?UTF-8?B?UGF2ZWwgRmVkaW4bU1JSLVBsYXRmb3JtIExhYhtTYW1zdW5n?= =?UTF-8?B?IEVsZWN0cm9uaWNzG1NlbmlvciBFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG0NJU0hRG0MxMEdEMDFHRDAxMDEwMQ==?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170524125429eucas1p1384ad5e0c60eb4974a0f57e0f0203d9a X-RootMTR: 20170524125429eucas1p1384ad5e0c60eb4974a0f57e0f0203d9a References: X-IsSubscribed: yes X-SW-Source: 2017-05/txt/msg00391.txt.bz2 Hello! I'd like to report a strange bug in 64-bit bash. The following script: ---- cut --- #/bin/bash -e DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" echo Works: $DIR ---- cut --- Simply exits and produces no output (never reaches echo). The same script works perfectly on 32 bits. Versions are the same: --- cut --- $ bash --version GNU bash, version 4.4.12(3)-release (x86_64-unknown-cygwin) Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software; you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. --- cut --- (of course i686 version prints "i686-pc-cygwin" here) If i remove "-e" argument, it starts working. If i break down the sequence into two lines: --- cut --- #/bin/bash -e DIR="$( dirname "${BASH_SOURCE[0]}" )" DIR="$( cd "$DIR" && pwd )" echo Result: $DIR --- cut --- then it also works on both versions of Cygwin. Kind regards, Pavel Fedin Senior Engineer Samsung Electronics Research center Russia -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple