delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/08/24/21:57:42

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
To: cygwin AT cygwin DOT com
From: Shankar Unni <shankarunni AT netscape DOT net>
Subject: Re: environment variable name converted to upper case
Date: Tue, 24 Aug 2004 18:57:11 -0700
Lines: 38
Message-ID: <cggrm3$vdv$1@sea.gmane.org>
References: <F76C9B2DA2FC4C4CA0A18E288BBCBCF708217C86 AT nihexchange24 DOT nih DOT gov> <20040822144651 DOT GA3391 AT coe DOT casa DOT cgf DOT cx> <cgdmn0$3sh$2 AT sea DOT gmane DOT org> <6 DOT 1 DOT 0 DOT 6 DOT 0 DOT 20040823215200 DOT 03423e28 AT pop DOT prospeed DOT net>
Mime-Version: 1.0
X-Complaints-To: usenet AT sea DOT gmane DOT org
X-Gmane-NNTP-Posting-Host: adsl-68-120-146-125.dsl.snfc21.pacbell.net
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040803 Thunderbird/0.7.3 Mnenhy/0.6.0.101
In-Reply-To: <6.1.0.6.0.20040823215200.03423e28@pop.prospeed.net>
X-IsSubscribed: yes

Larry Hall wrote:

> I'm not sure what you mean by 'Posix shells'.  Shells that come with the
> Cygwin environment don't expect uppercase.  Windows (and DOS) do, really.

OK, I was a little imprecise.

What I was trying to say was that NT *shells* preserves case in 
environment variables, but is case-insensitive in lookup. Which is why 
it allows variables like "Path" or "PATH" interchangeably. You can set 
"foo", but look up "%FoO%" or "%fOo", and it'll find that "foo" and 
return it. But just "set" prints out "foo=...", not "FOO=...".

"Posix shells" (OK, another bad term - I mean shells originally written 
to run on Unix-y or Posix-y systems - i.e. sh, bash, ksh, csh, etc., but 
not CMD, COMMAND.COM, 4NT, or others), on the other hand, are completely 
case-preserving and case-sensitive.

And in order to be able to see PATH in the environment in cygwin shells 
when the system had set Path, cygwin uppercases all environment vars 
when starting a cygwin process. What I was saying was, how about 
uppercasing just "Path/PATH"? We can leave the case of the others alone, 
as they are in the system environment.

OK, sure, there's minor complexity in saying

   if (stricmp(var, "path") == 0)
     uppercase(var)

instead of just

   uppercase(var)

but it reduces the needless element of surprise at the unnecessary 
munging of the environment.

Anyway, not a big point; just a suggestion, and it looks like it's been 
shot down. That's ok..


--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019