delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2020/11/20/17:40:03

X-Recipient: archive-cygwin AT delorie DOT com
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D66F63972479
Authentication-Results: sourceware.org; dmarc=none (p=none dis=none)
header.from=optusnet.com.au
Authentication-Results: sourceware.org;
spf=none smtp.mailfrom=dunc AT dimstar DOT local DOT net
Date: Sat, 21 Nov 2020 09:39:06 +1100
From: Duncan Roe <duncan_roe AT optusnet DOT com DOT au>
To: Jason Vas Dias <jason DOT vas DOT dias AT gmail DOT com>
Subject: Re: BUG: command invocation misinterpreted as variable setting,
SOMETIMES.
Message-ID: <20201120223906.GB7078@dimstar.local.net>
Mail-Followup-To: Jason Vas Dias <jason DOT vas DOT dias AT gmail DOT com>,
cygwin <cygwin AT cygwin DOT com>
References: <hh4klkully DOT fsf AT jvdspc DOT jvds DOT net>
MIME-Version: 1.0
In-Reply-To: <hh4klkully.fsf@jvdspc.jvds.net>
User-Agent: Mutt/1.10.1 (2018-07-13)
X-Optus-CM-Score: 0
X-Optus-CM-Analysis: v=2.3 cv=F8MpiZpN c=1 sm=1 tr=0 cx=a_idp_d
a=cy70b3iXcB9xLWzPsiLWxQ==:117 a=cy70b3iXcB9xLWzPsiLWxQ==:17
a=kj9zAlcOel0A:10 a=nNwsprhYR40A:10 a=RSmzAf-M6YYA:10
a=OHQyB3PeE4QDW6zJDJsA:9 a=CjuIK1q_8ugA:10
X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,
HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY,
RCVD_IN_DNSWL_LOW, SPF_HELO_PASS, SPF_NONE,
TXREP autolearn=no autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
Cc: cygwin <cygwin AT cygwin DOT com>
Errors-To: cygwin-bounces AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces AT cygwin DOT com>

Hi Jason,

On Fri, Nov 20, 2020 at 02:52:09PM +0000, cygwin wrote:
>
> Good day -
>
>  I am using a fairly up-to-date Cygwin:
>    release: cygwin
>    arch: x86_64
>    setup-timestamp: 1603379981
>    include-setup: setup <2.878 not supported
>    setup-minimum-version: 2.895
>    setup-version: 2.905
>  , bash version : 4.4.12(3)-release
>  on Windows 10 :
>    Edition	Windows 10 Pro
>    Version	20H2
>    OS build	19042.630
>    Experience	Windows Feature Experience Pack 120.2212.31.0
>  , which I am forced to use for a work related Visual Studio project,
>  , running in a Qemu/KVM VM under Fedora-32 on a modern X86_64 Dell XPS
>  laptop, and am experiencing some strange and disconcerting behaviour:
>
>  I am a complete novice Windows user, I have used only BSD / Solaris
>  / AIX / HP-UX / MacOSX / z/OS or Linux since 1990, so I am an advanced UNIX
>  shell script user & C/C++ + LISP + PERL programmer (I prefer LISP nowadays).
>
>  I have to run a script with an alternate setting of $HOME, so I do:
>
>    $ HOME="C:\\USERS\\JVD\\" sbcl --script "C:\\${path-to-my-script}.lisp"
>
>  This works, but now:
>
>    $ cd ~
>    -bash: cd: "C:\\USERS\\JVD\\" sbcl --script "C:\\${path-to-my-script}.lisp": No such file or directory
>    $ echo $HOME
>    /home/JVD
>
>  This is very weird! "$HOME" is still set to its /etc/bash.bashrc set
>  default, but evaluation of 'echo ~', which I thought should be
>  equivalent to 'echo $HOME', yields the last command to be prefixed
>  by a command-specific HOME=... setting .
>
>  I think this is a bug. Since setting HOME=... has no effect now,
>  (it still has its correct value),
>  use of '~' is now effectively disabled for this shell session .
>
>  What is 'echo ~' doing other than 'echo $HOME' ?

If you had tried 'set -x' you would have seen what it does: tilde expansion is
done by bash before the echo command is invoked. So you would see something like
'echo /home/jvd'.

Could it be that 'sbcl' has popped a new bash command level?

I can't reproduce your issue with a simple command instead of 'sbcl' e.g.

> 09:33:42$ HOME="C:\\USERS\\DUNCAN\\" pwd
> /home/dunc
> 09:34:02$ echo ~
> /home/dunc
>
[...]
>
Cheers ... Duncan.
--
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

- Raw text -


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