public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Csaba Raduly <rcsaba@gmail.com>
To: john doe <johndoe65534@mail.com>
Cc: cygwin list <cygwin@cygwin.com>
Subject: Re: Program files environmental variables
Date: Tue, 23 Nov 2021 10:52:18 +0100	[thread overview]
Message-ID: <CAEhDDbD8XK+pyt=4PjJBF21D1YfYNDDOYm3-VwfYBdOERd2SEg@mail.gmail.com> (raw)
In-Reply-To: <693ff161-60af-7e60-7325-ce0f2b42acc0@mail.com>

On Tue, 23 Nov 2021 at 10:02, john doe via Cygwin <cygwin@cygwin.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)

  reply	other threads:[~2021-11-23  9:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-23  9:02 john doe
2021-11-23  9:52 ` Csaba Raduly [this message]
2021-11-23 10:40   ` Lemures Lemniscati
2021-11-23 13:10 ` Eliot Moss
2021-11-23 15:15   ` john doe
2021-11-23 15:27     ` Eliot Moss
     [not found] ` <DB9PR08MB6842C067DA1DB291FBD666A0E9609@DB9PR08MB6842.eurprd08.prod.outlook.com>
2021-11-23 15:11   ` john doe
2021-11-23 18:07 ` Brian Inglis

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='CAEhDDbD8XK+pyt=4PjJBF21D1YfYNDDOYm3-VwfYBdOERd2SEg@mail.gmail.com' \
    --to=rcsaba@gmail.com \
    --cc=cygwin@cygwin.com \
    --cc=johndoe65534@mail.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).