On 11/23/2021 2:10 PM, Eliot Moss wrote:
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

What version of Cygwin bash are you using?

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


Thank you.

--
John Doe

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

Reply via email to