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]

RE: incompatible environment variable names


> From: Steven Collins
> On Wed, Aug 4, 2010 at 10:23, Nellis, Kenneth wrote:
> > 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
> >
> 
> From the bash man page:
<snip/>
> 
> Hench bash does not support the plus character in a variable name and
> no amount of finagling is going to fix it.

Well, *somehow* it got into the Cygwin environment, and cygwin.bat directly
invokes bash, so I interpret this as bash creating the Cygwin environment.
Where is the hole in this logic?

--Ken Nellis

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