Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: From: "Buchbinder, Barry (NIH/NIAID)" To: "'cygwin AT cygwin DOT com'" Subject: RE: environment variable name converted to upper case Date: Sat, 21 Aug 2004 13:06:50 -0400 MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes To expand on what Chris wrote, this is caused by the fact that in command.com (but not cmd.exe as supplied by XP - I don't know about earlier versions of cmd.exe) all user-setable Windows environmental variable are uppercase. Try this in command.com: > set You will see all the environmental variable are uppercase. Now > set zzz=aaa > set will show that zzz is listed as ZZZ=aaa Now > echo %ZZZ% aaa > echo %zzz% aaa Note that in some versions of Windows, Windows itself sets a variable with a lowercase name so that it would be impossible for the user to set it. Windows 98se has windir=C:\WINDOWS I can > set windir=xxx and find that windir=C:\WINDOWS is unchanged but I now have a variable WINDIR=xxx But it cannot be accessed as seen by > echo %windir% C:\WINDOWS > echo %WINDIR% C:\WINDOWS My guess is that on XP, cygwin.bat runs under command.com (which is available under all versions of Windows), not cmd.exe (provided only with NT/2k/XP). As Chris said, the easiest way to set the variable is in the shell. Under NT/2k/XP, you might get the behavior you want by changing cygwin.bat to cygwin.cmd, or running bash directly (if the variable is set in the global environment). You'll have to experiment. For the record, under Windows 9x/Me, setting the environmental variable in the shell is probably the only way to do it. -----Original Message----- From: Christopher Faylor [mailto:cgf-no-personal-reply-please AT cygwin DOT com] Sent: Saturday, August 21, 2004 12:21 PM To: cygwin AT cygwin DOT com Subject: Re: environment variable name converted to upper case On Sat, Aug 21, 2004 at 09:30:53PM +0530, Koduru, Seshasai wrote: >An environment variable name defined in windows environment with >lowercase is converted to uppercase by cygwin environment. > >Because of this behavior the shell scripts are not recognizing >$lowercase variable. Is this the regular expected behavior? Yes. >Is there any way to get the case preserved? Don't set the environment variable at the windows level. Set it in the shell prior to running the program. If that isn't adequate, then there probably isn't any way to do what you want. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/ -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/