This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

incompatible environment variable names


I came across an interesting (IMHO) incompatibility between 
Windows and bash environment variable names.

I have a Windows environment variable as such:

C:\>set QNX_VISUAL_C++_PATH
QNX_VISUAL_C++_PATH=C:\Program Files\Orbital Qnx VisualC++ IDE

So, Windows has no problem with + symbols in variable names, but
bash does, kinda sorta:

Cygwin> printenv QNX_VISUAL_C++_PATH
C:\Program Files\Orbital Qnx VisualC++ IDE
Cygwin> cygpath "$QNX_VISUAL_C++_PATH"
++_PATH
Cygwin> echo "$QNX_VISUAL_C++_PATH"
++_PATH
Cygwin> echo ${QNX_VISUAL_C++_PATH}

Cygwin> cygpath "$(printenv QNX_VISUAL_C++_PATH)"
/cygdrive/c/Program Files/Orbital Qnx VisualC++ IDE
Cygwin>

So, it seems that I can only access the value of the variable 
through printenv, and then cygpath does what I need, but I can't 
then assign it back to the environment variable:

Cygwin> export QNX_VISUAL_C++_PATH="$(cygpath "$(printenv QNX_VISUAL_C++_PATH)")"
-bash: export: `QNX_VISUAL_C++_PATH=/cygdrive/c/Program Files/Orbital Qnx VisualC++ IDE': not a valid identifier
Cygwin>

I probably need to give up on this, but felt like sharing my misery.

--Ken Nellis

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]