incompatible environment variable names

Corinna Vinschen
Wed Aug 4 19:24:00 GMT 2010

On Aug  4 13:59, Nellis, Kenneth wrote:
> > From: Steven Collins
> > On Wed, Aug 4, 2010 at 10:23, Nellis, Kenneth wrote:
> > > [...]
> > > So, Windows has no problem with + symbols in variable names, but
> > > bash does, kinda sorta:
> > > [...]
> > 
> > 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?

The environment is converted by the Cygwin DLL, not by bash.  And, even
though the '+' character is *theoretically* allowed in a POSIX
environment variable name(*), neither bash nor tcsh(**) handles it
transparently as part of a variable name.  This is *not* a Cygwin

    Accentuation added by me:

  Environment variable names used by the utilities in the Shell and
  Utilities volume of POSIX.1-2008 consist solely of uppercase letters,
  digits, and the <underscore> ( '_' ) from the characters defined in
  [ASCII] and do not begin with a digit. Other characters *may* be
  permitted by an implementation; applications *shall* tolerate the
  presence of such names.

(**) On Linux:

  tcsh$ $ echo $version
  tcsh 6.17.00 (Astron) 2009-07-10 (x86_64-unknown-linux) options wide,nls,dl,al,kan,rh,color,filec
  tcsh$ setenv QNX_VISUAL_C++_PATH foo
  tcsh$ env | grep QN
  tcsh$ echo $QNX_VISUAL_C++_PATH
  QNX_VISUAL_C: Undefined variable.
  tcsh$ echo ${QNX_VISUAL_C++_PATH}
  Missing }.
  tcsh$ echo "$QNX_VISUAL_C++_PATH"
  QNX_VISUAL_C: Undefined variable.


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

Problem reports:
Unsubscribe info:

More information about the Cygwin mailing list