From: colin AT bird DOT fu DOT is DOT saga-u DOT ac DOT jp (Colin Peters) Subject: RE: Env variable name trouble 3 Dec 1996 23:05:49 -0800 Sender: daemon AT cygnus DOT com Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: <01BBE1F7.E87257C0.cygnus.gnu-win32@gbird0.fu.is.saga-u.ac.jp> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Original-To: "'Soorya Kuloor'" Original-Cc: "'GNU-Win32'" Original-Sender: owner-gnu-win32 AT cygnus DOT com Soorya Kuloor[SMTP:soorya AT calgary DOT hp DOT com] wrote: >I set an environment variable in bash with mixed case name, for example >includeFilesDir as > export includeFilesDir=blablabla > >Then if I start a subshell, in the subshell the name of the env variable >gets changed to INCLUDEFILESDIR, so > echo $includeFilesDir >in the subshell does not work. [big snip] > >Any help as to how to fix this problem, or a work around (other than using >all upper case env >variable names :-)) this problem will be greatly appreciated. I'm sure that someone at Cygnus knows a lot more about this than me, but... I remember seeing a reference in someone's code (Cygnus?) that Windows NT retains the case of environment variables- kinda-sorta. I also remember seeing somewhere else that environment variable names were being converted to all uppercase to be compatible with the command shell in NT. I definitely remember seeing some mention that if you search for environment variables in a case sensitive manner you may not get your variable. I don't know if Cygnus, or even MS's implementations of getenv are case sensitive or not, though I wouldn't be particularly surprised if they were. In code you can always search the _environ (or is it __environ) block yourself using strcmpi (or is it stricmp), but in shells... What it comes down to is: maybe you should use all uppercase environment variable names. Of course I'm almost willing to bet money that what you are dealing with is a bunch of shell scripts and/or makefiles which depend on this feature and would be a major pain to fix. It should, of course, be possible to get bash to use case-insensitive environment variable naming. Of course, there is no doubt in my mind that there are plenty of shell scripts out there which not only use case sensitive names, but use multiple variables only differentiated by the case of their names. I guess one could work it out so that bash preserved the case of environment variables when starting sub-shells, although god knows how much code that might take. Depending on who's doing the conversion to all uppercase and where, it could be easy... (good luck) Colin. -- Colin Peters - colin AT bird DOT fu DOT is DOT saga-u DOT ac DOT jp -- Saga University Dept. of Information Science -- Fundamentals of Information Science -- http://www.fu.is.saga-u.ac.jp/~colin/home.html - For help on using this list, send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".