From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by sourceware.org (Postfix) with ESMTPS id 75B603857C43 for ; Tue, 23 Nov 2021 09:52:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 75B603857C43 Received: by mail-wr1-x429.google.com with SMTP id u18so37919939wrg.5 for ; Tue, 23 Nov 2021 01:52:39 -0800 (PST) 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@mail.com> In-Reply-To: <693ff161-60af-7e60-7325-ce0f2b42acc0@mail.com> From: Csaba Raduly Date: Tue, 23 Nov 2021 10:52:18 +0100 Message-ID: Subject: Re: Program files environmental variables To: john doe Cc: cygwin list Content-Type: text/plain; charset="UTF-8" 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@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: Tue, 23 Nov 2021 09:52:41 -0000 On Tue, 23 Nov 2021 at 10:02, john doe via Cygwin 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)