From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from p3plsmtpa08-10.prod.phx3.secureserver.net (p3plsmtpa08-10.prod.phx3.secureserver.net [173.201.193.111]) by sourceware.org (Postfix) with ESMTPS id AC0473857C5C for ; Sat, 5 Sep 2020 03:22:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org AC0473857C5C Received: from [10.0.0.54] ([71.198.0.12]) by :SMTPAUTH: with ESMTPSA id EOmRkPLyoc2JBEOmRkvrRn; Fri, 04 Sep 2020 20:22:19 -0700 X-CMAE-Analysis: v=2.3 cv=ffXTNHYF c=1 sm=1 tr=0 a=rov2TMmdNa1L32Ajm2rx/g==:117 a=rov2TMmdNa1L32Ajm2rx/g==:17 a=IkcTkHD0fZMA:10 a=x7bEGLp0ZPQA:10 a=loFcDopfAy4A:10 a=YtygPl7jKoKW-k0D3gAA:9 a=QEXdDO2ut3YA:10 X-SECURESERVER-ACCT: bob@bnlmcgowan.net To: The Cygwin Mailing List From: Bob McGowan Subject: Is this a bug in bash? Message-ID: <50fad2a4-22c3-8de8-3a0a-394c0b95048b@gmail.com> Date: Fri, 4 Sep 2020 20:22:18 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-CMAE-Envelope: MS4wfCWTdLidWZhGNksOKAPUvkOHCDueHBcL9/81WqpPSjz+4be7b/tb7MMeIMa39g8GryoMCaRcl9oUBtTUmVyXMZkNKrt+j40OwvnvbMsEIsEyQe7SfVAU 5FWHxKBJKH3CWW3NBr7Ty15l4S0blXHdVDeHk6Sd1t/3zShc3AX3emnB X-Spam-Status: No, score=2.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FORGED_GMAIL_RCVD, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, KAM_DMARC_NONE, KAM_DMARC_STATUS, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_SOFTFAIL, SPOOFED_FREEMAIL, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Sep 2020 03:22:21 -0000 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