From: Pavel Fedin <p.fedin@samsung.com>
To: cygwin@cygwin.com
Subject: Bug: bash -e misbehaves with several nested
Date: Wed, 24 May 2017 15:55:00 -0000 [thread overview]
Message-ID: <000e01d2d48c$e16d1ca0$a44755e0$@samsung.com> (raw)
In-Reply-To: <CGME20170524125429eucas1p1384ad5e0c60eb4974a0f57e0f0203d9a@eucas1p1.samsung.com>
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
next parent reply other threads:[~2017-05-24 12:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20170524125429eucas1p1384ad5e0c60eb4974a0f57e0f0203d9a@eucas1p1.samsung.com>
2017-05-24 15:55 ` Pavel Fedin [this message]
2017-05-24 19:32 ` Marco Atzeri
2017-05-25 10:31 ` Pavel Fedin
2017-05-25 13:35 ` Marco Atzeri
2017-05-31 9:48 ` Pavel Fedin
2017-05-25 14:54 ` Andrey Repin
2017-05-25 18:03 ` Brian Inglis
2017-11-10 16:43 ` Pavel Fedin
2017-11-11 18:12 ` Brian Inglis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='000e01d2d48c$e16d1ca0$a44755e0$@samsung.com' \
--to=p.fedin@samsung.com \
--cc=cygwin@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).