delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/05/24/08:55:10

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:subject:date:message-id:mime-version
:content-type:content-transfer-encoding:references; q=dns; s=
default; b=rq7LZuRWckA55AJ7z0GQI4EqHfZHSJBsLbaSgvhhVrA1J7G4C3k9I
QfBBBjriOGk713gJ/tZwpU6M7yH5enWe0s7bpwLZKR4N/xq5zQd+90OT2g7b9NeS
Or/PhRQeK9WMywLLKbiEmwEQMnyHMsrda5KzhEmSBdqb6pml+f/ht0=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:subject:date:message-id:mime-version
:content-type:content-transfer-encoding:references; s=default;
bh=R63sBtDL5FjJ3sz8W5tkYnoasgw=; b=XsH3jVP66dCvJkSgbta3lTtgZNY4
RAj4nF3+HNxv07ZqROixViLD7Jlq/zlU7VvJH30UbFlt8VPq9x5uqoFlJJN8U3Lw
TXGeUzmm3F36zmk1BaGC6ZzaoZFsGnA0n0IPYPbqvdlTOCZexRrwROlVWhfUJRwc
YkE677xChTpm5cU=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
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
From: Pavel Fedin <p DOT fedin AT samsung DOT com>
To: cygwin AT cygwin DOT com
Subject: Bug: bash -e misbehaves with several nested
Date: Wed, 24 May 2017 15:54:27 +0300
Message-id: <000e01d2d48c$e16d1ca0$a44755e0$@samsung.com>
MIME-version: 1.0
X-MTR: 20000000000000000 AT 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: <CGME20170524125429eucas1p1384ad5e0c60eb4974a0f57e0f0203d9a AT eucas1p1 DOT samsung DOT com>
X-IsSubscribed: yes

 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 <http://gnu.org/licenses/gpl.html>

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019