From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailsrv.cs.umass.edu (mailsrv.cs.umass.edu [128.119.240.136]) by sourceware.org (Postfix) with ESMTPS id CAEBF3858405 for ; Tue, 23 Nov 2021 13:10:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CAEBF3858405 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=cs.umass.edu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cs.umass.edu Received: from [192.168.50.148] (c-24-62-201-179.hsd1.ma.comcast.net [24.62.201.179]) by mailsrv.cs.umass.edu (Postfix) with ESMTPSA id 16F24400F2EA; Tue, 23 Nov 2021 08:10:38 -0500 (EST) Reply-To: moss@cs.umass.edu Subject: Re: Program files environmental variables To: john doe , cygwin@cygwin.com References: <693ff161-60af-7e60-7325-ce0f2b42acc0@mail.com> From: Eliot Moss Message-ID: <46d3d516-fac6-ca09-0166-398670c28cd6@cs.umass.edu> Date: Tue, 23 Nov 2021 08:10:39 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: <693ff161-60af-7e60-7325-ce0f2b42acc0@mail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, NICE_REPLY_A, 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 13:10:43 -0000 On 11/23/2021 4:02 AM, john doe via Cygwin wrote: > Cygwins, > > Is there a way to get the value of PROGRAMFILES(x86) and PROGRAMW6432 in > Bash: > > $ echo $PROGRAMFILES; echo "$PROGRAMFILES(x86)"; echo $PROGGRAMW6432 > C:\Program Files > C:\Program Files(x86) > > $ cmd.exe /C "echo %PROGRAMFILES% %PROGRAMFILES(x86)% %PROGRAMW6432%" > C:\Program Files C:\Program Files (x86) C:\Program Files > > > PROGRAMFILES works in Bash but not the other two. PROGRAMW6432 exists in my Cygwin bash, and I know I did not set it explicitly. As for the x86 one, parentheses are not allowed in bash variable names. In principle one could set up, say, PROGRAMFILESx86, however no path of that kind is around in my bash. It would be possible to read it out and setup the variable. I found, for example, that this prints out the setting of the variable (but with other gorp you'd have to edit out): echo "echo %PROGRAMFILES(x86)%; exit" | cmd I forget where these are set up - I think in the Cygwin code. I'm sure someone else will point that out! Best - Eliot