public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Greg Borbonus <gregborbonus@gmail.com>
To: Bob McGowan <ramjr0915@gmail.com>
Cc: The Cygwin Mailing List <cygwin@cygwin.com>
Subject: Re: Is this a bug in bash?
Date: Sat, 5 Sep 2020 10:29:08 -0500	[thread overview]
Message-ID: <CAOXR0FfRVspg7VCVH3zfvvY6E33JCcyuoU=b6nuvL1bYvFr2qA@mail.gmail.com> (raw)
In-Reply-To: <50fad2a4-22c3-8de8-3a0a-394c0b95048b@gmail.com>

Out of curiosity, why are there 2 different sets of quotes?

Thanks,
Greg Borbonus

On Fri, Sep 4, 2020, 10:23 PM Bob McGowan via Cygwin <cygwin@cygwin.com>
wrote:

> I am trying to set things up so the Bash profile detects if bash is
> running from the Windows "XWin Server" startup link or not. The startup
> link has the following as the command:
>
> C:\cygwin64\bin\run.exe --quote /usr/bin/bash.exe -l -c "cd; exec
> /usr/bin/startxwin"
>
> So I thought I'd try adding the env command to set an environment variable:
>
> C:\cygwin64\bin\run.exe --quote /usr/bin/env startxwin=yes
> /usr/bin/bash.exe -l -c "cd; exec /usr/bin/startxwin"
>
> This works (if there's a better way, I'd be happy to learn of it) but in
> the process of testing I had a problem when echo'ing the variable.
>
> For purposes of describing the bug, I simplified the command as follows:
>
>      env startup=yes bash -l -c 'echo "cmd:  $startup"'
>
> I also added an "echo profile: $startup" to the .bash_profile file.
>
> When I run the above in a Cygwin shell, the output is:
>
> $ env startup=yes bash -l -c "echo cmd: $startup"
> profile: yes
> $
>
> When I run it in a Linux shell, the output is:
>
> $ env startup=yes bash -l -c 'echo "cmd:  $startup"'
> profile: yes
> cmd:  yes
> $
>
> As you can see, the Cygwin side fails to generate any output from the -c
> echo command but on the Linux system there is output.
>
> Normally I'd call this a bug but since this is running under Windows it
> may be some weirdness of the implementation required to create the Linux
> like environment.
>
> The Bash version in Cygwin is  4.4.12(3)-release and for my Debian Linux
> system, it is 5.0.3(1)-release.  So it could also be that it existed in
> Linux 4.x series and has been fixed in the 5.x series.
>
> Bob
>
> --
> Problem reports:      https://cygwin.com/problems.html
> FAQ:                  https://cygwin.com/faq/
> Documentation:        https://cygwin.com/docs.html
> Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple
>

  reply	other threads:[~2020-09-05 15:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-05  3:22 Bob McGowan
2020-09-05 15:29 ` Greg Borbonus [this message]
2020-09-05 15:44   ` Eliot Moss
2020-09-05 16:57     ` Greg Borbonus
2020-09-05 17:11       ` Eliot Moss
2020-09-05 19:18     ` Bob McGowan
2020-09-05 22:25       ` Eliot Moss

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='CAOXR0FfRVspg7VCVH3zfvvY6E33JCcyuoU=b6nuvL1bYvFr2qA@mail.gmail.com' \
    --to=gregborbonus@gmail.com \
    --cc=cygwin@cygwin.com \
    --cc=ramjr0915@gmail.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).