delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2021/11/23/04:53:49

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5D5A63858436
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1637661228;
bh=v2woJ0AugBDkqtcm+b14qAcNgPaxDBgTKUAspBv+DLY=;
h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
From;
b=EpRlG6yug2x36n/S8oeV52M0gsmqwj1IBvG6mJyJ18PwKAY9wtTwj0Res6+c7F1ga
M5cdypF1DpHC1rZCeVi9Y/a/aUHbafLkbJrMMtF/pBBMoOO2Pn9Ws1WSEa/s0BTxvv
ZFr7fmPr8Ky8rkmniY5u2xnjlC59NHdKS5Oo5YJ8=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 75B603857C43
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to:cc;
bh=b2uag3iWUQKzd3CxjzkByua7jttwP7mr8xpIy7Jx5Ps=;
b=qhtBtIQtnPTU/M5MyWlnHVndyiLuzD7efWKqW58RntpxkDwX7q+fqSEj4pR5Gcqctr
5C797x0gq6mFdGUbPMJgs/qW64xyowXbd5Z8fL7W3tGhQO95ZtcH+p1bZTPiWjitixUj
46TWswkae7oxUV4f9Hb106vgc7V9SnxjpOJi29TSDhw4I5s4JXMVaK+KIZxzuTI2XEyn
/sb9d8FWJxNfJOHPUx+CcEm90uWrPvUAwE7jgiXLFvhVFT6bTHIrnjpZ/9vOg0FmPIwf
YrCaaJKNElRwO90KsKj+SfOW/hvkd7j3RX2GH8MqrfbSiu9ThIrmv2cT88tihr9NJIBH
F+fg==
X-Gm-Message-State: AOAM531NmoOm5iX1bxMwa95U2q3Xv8rk3YPp32GO6xgzFxEsDs0N36Qq
kFxKBvBFbs8LSdvOM2i/OqcfkVATW5cGP7lckmQNeaz8vU+CQA==
X-Google-Smtp-Source: ABdhPJw8XlOpHtiWKFaQ/Fe88TuuFDJFDopIT7Svk9IrCXsh2ptqockh+Mwhci7bgfy8JNGIodzmkDf1wheI96lAAyM=
X-Received: by 2002:adf:edc1:: with SMTP id v1mr2842315wro.170.1637661158462;
Tue, 23 Nov 2021 01:52:38 -0800 (PST)
MIME-Version: 1.0
References: <693ff161-60af-7e60-7325-ce0f2b42acc0 AT mail DOT com>
In-Reply-To: <693ff161-60af-7e60-7325-ce0f2b42acc0@mail.com>
Date: Tue, 23 Nov 2021 10:52:18 +0100
Message-ID: <CAEhDDbD8XK+pyt=4PjJBF21D1YfYNDDOYm3-VwfYBdOERd2SEg@mail.gmail.com>
Subject: Re: Program files environmental variables
To: john doe <johndoe65534 AT mail DOT com>
X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,
SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4
X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Csaba Raduly via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Csaba Raduly <rcsaba AT gmail DOT com>
Cc: cygwin list <cygwin AT cygwin DOT com>
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

On Tue, 23 Nov 2021 at 10:02, john doe via Cygwin <cygwin AT cygwin DOT com> wrote:
>
> Cygwins,
>
> Is there a way to get the value of PROGRAMFILES(x86) and PROGRAMW6432 in
> Bash:
>

$ env | grep PROGRAMFILES
COMMONPROGRAMFILES=C:\Program Files\Common Files
PROGRAMFILES=C:\Program Files

These are the environment variables visible in my Cygwin environment.

echo "$PROGRAMFILES(x86)" is the equivalent of echo
"${PROGRAMFILES}(x86)" i.e. the value of $PROGRAMFILES, followed by
the fixed string "(x86)"

I tried

$ echo "${PROGRAMFILES(x86)}"
$ echo "${PROGRAMFILES\(x86\)}"

and bash outright refused them ("bad substitution"). So it may not be
possible to have an environment variable with ()s in its name.

Csaba
-- 
You can get very substantial performance improvements
by not doing the right thing. - Scott Meyers, An Effective C++11/14 Sampler
So if you're looking for a completely portable, 100% standards-conformant way
to get the wrong information: this is what you want. - Scott Meyers (C++TDaWYK)

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