public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Marco Atzeri <marco.atzeri@gmail.com>
To: Pavel Fedin <p.fedin@samsung.com>, cygwin@cygwin.com
Subject: Re: Bug: bash -e misbehaves with several nested
Date: Thu, 25 May 2017 13:35:00 -0000	[thread overview]
Message-ID: <7eaf015c-431f-8a2e-1b2f-0db58d42df75@gmail.com> (raw)
In-Reply-To: <000e01d2d53d$57318470$05948d50$@samsung.com>

On 25/05/2017 11:57, Pavel Fedin wrote:
>  Hello!
>
>>>  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 ---
>>
>> It works fine for me.
>>
>> $ ./prova.bash
>> Works: /tmp
>
>  Huh, works here too, indeed. But there's one little thing. If you just copypasted this from my email, then you probably miss "#!"
> (there's just "#", since i retyped the header, and made a typo). And with this typo it really works for some reason. Could you make
> sure once again ?
>  Apparently it has to do with -e switch.



$ ./prova_bash
Works: /cygdrive/e/cygwin/tmp

$ cat prova_bash
#!/bin/bash -e

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo Works: $DIR



--
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

  reply	other threads:[~2017-05-25 10:31 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
2017-05-24 19:32   ` Marco Atzeri
2017-05-25 10:31     ` Pavel Fedin
2017-05-25 13:35       ` Marco Atzeri [this message]
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=7eaf015c-431f-8a2e-1b2f-0db58d42df75@gmail.com \
    --to=marco.atzeri@gmail.com \
    --cc=cygwin@cygwin.com \
    --cc=p.fedin@samsung.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).