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


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
problem(**).

(*) http://www.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html
    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
  QNX_VISUAL_C++_PATH=foo
  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

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

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


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