delorie.com/archives/browse.cgi | search |
X-Recipient: | archive-cygwin AT delorie DOT com |
DKIM-Filter: | OpenDKIM Filter v2.11.0 sourceware.org E321E3984067 |
DKIM-Signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; |
s=default; t=1605883938; | |
bh=W4t6cLjyx8cfdmINbqtYHdpGfKNUKUpIIZW/caVqDo4=; | |
h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: | |
List-Help:List-Subscribe:From:Reply-To:From; | |
b=DWGPL2F1ZHJfLNObbw2cMVLBxwpLYiNEQ2lKs90y9nnAX/naN3GG/ZSo9TzD+BsNg | |
kBag5KncjLALRYkN99d46V9qeNYzwevLe4vdkDzfMgpZR8+Ab5Sjc7T9bGUp4uCReL | |
UXHmgR6tYXTk/BZ8SUfL5TtslDjMhA+C8VQIAn3k= | |
X-Original-To: | cygwin AT cygwin DOT com |
Delivered-To: | cygwin AT cygwin DOT com |
DMARC-Filter: | OpenDMARC Filter v1.3.2 sourceware.org 738DD398301B |
X-Google-DKIM-Signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; |
d=1e100.net; s=20161025; | |
h=x-gm-message-state:from:to:subject:reply-to:date:message-id | |
:mime-version; | |
bh=Gp8KrlpyRPK/REAT5BzPYQFIHWYGeqLoVx29rAI4dNs=; | |
b=ZU4kcfQpTOzLs8G51ZKs7EG8vcZ8lPsxwMQQsDuAMVasMnwsIqHnI8qCUKnNMTAoTo | |
EE/nyGKKWUtrE6ICLamZIG1UfXN5S0kQt9z/++wfODVi1ij9j+WlTiOwDy7FVfRIHFma | |
VgLxt24vBDOoLYia85XNVb7pISEeCVYqNP4T9cLSk6AU5MGyV9wwJoCVSb6FRRdjam0Q | |
pBhDSvkPNMPnNZD2QVC7GAKk3rbM6N+3oBCyDFf6bXNUxnT0wdnrb99BBu+BfgcPxKff | |
OUvKte7GJyCLM8CFZicVCJCjSlquuxTo5QnBdJpGYq5CkFOIYP21x90B5f0HUNPR8lXH | |
xoeQ== | |
X-Gm-Message-State: | AOAM531j2VhUT645a0Nq4UHaVIt+yZOc3WKNAiqfFGJxBL5/jiUCWWib |
1ukel4RDXZ+ZsE+HP0TwFBeWgbOzn98= | |
X-Google-Smtp-Source: | ABdhPJxeno/ECilMpXK67CPmJLilA4bIaCVqkW5LpOTAvTxd6qbxVCYQOvmLPUznz7+YAmZ8frrD6Q== |
X-Received: | by 2002:adf:a343:: with SMTP id d3mr16518300wrb.91.1605883932707; |
Fri, 20 Nov 2020 06:52:12 -0800 (PST) | |
X-Authentication-Warning: | jvdspc.jvds.net: jvd set sender to |
jason DOT vas DOT dias AT gmail DOT com using -f | |
To: | cygwin AT cygwin DOT com |
Subject: | BUG: command invocation misinterpreted as variable setting, |
SOMETIMES. | |
Date: | Fri, 20 Nov 2020 14:52:09 +0000 |
Message-ID: | <hh4klkully.fsf@jvdspc.jvds.net> |
MIME-Version: | 1.0 |
X-Spam-Status: | No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, |
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, FROM_MISSP_FREEMAIL, | |
RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, | |
TXREP autolearn=ham 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-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> | |
From: | Jason Vas Dias via Cygwin <cygwin AT cygwin DOT com> |
Reply-To: | Jason Vas Dias <jason DOT vas DOT dias AT gmail DOT com> |
Sender: | "Cygwin" <cygwin-bounces AT cygwin DOT com> |
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' ? This is a serious bug to me. I also have some unanswerable questions niggles: ( where ${path-to-my-script} is the actual name of my script file, not an env var. SBCL is the Windows build of Steel Bank Common Lisp, installed under "C:\\Program\ Files\\", which does not use the Cygwin libraries, and accepts Windows style paths as 'native-namestring's , while converting pathnames to the 'c:/x/y/z' form with 'namestring'. Incidentally, can anyone enlighten me as to why a Windows path cannot be specified like: "C:\\Program\ Files\ \(x86\)\\" and used successfully in Cygwin ? Or why a path like that must be specified like: /cygdrive/c/Program\ Files\ \(x86\)/... on the command line to work in bash completion, but must be specified like: /cygdrive/c/Program Files (x86)/... to work in $PATH ? It would be nice to have some consistency here, so that scriptlets like the commented out section will work: function CYGP() # convert windows path to Cygwin path { if (( $# < 1 )); then echo "$FUNCNAME: expects <windows path list> argument." >&2; return 1; fi declare IFS=';'; declare -a P=($1); declare p='' path=''; declare -l lcdl; unset IFS; for p in "${P[@]}"; do p="${p//\\//}"; # while [[ "$p" =~ ^(.*[^\\])?([][[:space:])(}{])(.*)$ ]]; do # p="${BASH_REMATCH[1]}\\${BASH_REMATCH[2]}${BASH_REMATCH[3]}"; # done # # I can't understand why Cygwin can't handle escaped spaces in $PATH, but it can't! # if [[ "$p" =~ ^([a-zA-Z])[\:](.*)$ ]]; then lcdl="${BASH_REMATCH[1]}"; p="/cygdrive/${lcdl}${BASH_REMATCH[2]}"; fi path="$path${path:+:}$p"; done echo "$path"; } It would be nice to be able to uncomment that section in CYGP, which does escape all occurences of '[](){}' or [[:space:]] correctly, but if used in a $PATH setting, those characters cannot be escaped, otherwise that path is not searched. Why? ) Clarification on the above issues and an eventual fix for them would be much appreciated. Since I am running Windows under a Linux VM, solutions like MSYS2 or Windows Services for Linux (WSL), which seem to require one to install a complete Linux distribution under Windows, are overkill / sledgehammer approaches for me - I don't have the diskspace . Windows & Cygwin installed in only 16GB, but Visual Studio consumes @ 50GB, and that's enough Windows binaries for me ! Any advice gratefully received. Thanks & Best Regards, Jason -- 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
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |