X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Date: Wed, 2 Dec 2009 13:36:53 -0500
From: Christopher Faylor <cgf-use-the-mailinglist-please@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Base-Files (was Re: Unset TMP/TEMP in profile?)
Message-ID: <20091202183652.GA13591@ednor.casa.cgf.cx>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <4B14573C.3040409@alice.it>  <a13b5a590911301753w74ccf298g669e55fc58d36c50@mail.gmail.com>  <20091201091515.GC30043@calimero.vinschen.de>  <b610e770a6f8ab524e0df3c9ce625e84.squirrel@mail.morrison.mine.nu>  <a13b5a590912010832t52d7ed9cjd2c093ac7d6ea9a4@mail.gmail.com>  <89d87180772edf0cb5974b7d21ed1f50.squirrel@mail.morrison.mine.nu>  <20091202093042.GO8059@calimero.vinschen.de>  <4B16A22A.4070402@towo.net>  <20091202182140.GT8059@calimero.vinschen.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20091202182140.GT8059@calimero.vinschen.de>
User-Agent: Mutt/1.5.20 (2009-06-14)
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On Wed, Dec 02, 2009 at 07:21:40PM +0100, Corinna Vinschen wrote:
>On Dec  2 18:21, Thomas Wolff wrote:
>> Corinna Vinschen wrote in another thread about setting LANG:
>> >>... Andy and Thomas, please work
>> >>out the best solution together.  It should work in sh and csh.  Then
>> >>post it as reply to http://cygwin.com/ml/cygwin/2009-12/msg00090.html so
>> >>John can put it into the base-files package.
>> Our worked-out proposal is as follows:
>> 
>> 
>> /etc/profile.d/lang.sh:
>> 
>> # if no locale variable is set, indicate terminal charset via LANG
>> test -z "${LC_ALL:-${LC_CTYPE:-$LANG}}" && export LANG=C.UTF-8
>> 
>> /etc/profile.d/lang.csh:
>> 
>> # if no locale variable is set, indicate terminal charset via LANG
>> ( test $?LC_ALL = 0 || test -z "$LC_ALL" ) && ( test $?LC_CTYPE = 0 || test -z "$LC_CTYPE" ) && ( test $?LANG = 0 || test -z "$LANG" ) && setenv LANG C.UTF-8
>
>Thanks to both of you.

I wasn't paying attention before, so I apologize for not commenting
sooner but couldn't all of the above be one test statement or at least
handled inside '{}' rather than '()'.  Maybe bash optimizes that away
but, if it doesn't, then forking subshells will be rather expensive on
Cygwin.

cgf

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

