delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/08/21/11:57:57

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-3.3 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RP_MATCHES_RCVD,SPF_HELO_PASS
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Achim Gratz <Stromeko AT nexgo DOT de>
Subject: Re: /etc/profile
Date: Tue, 21 Aug 2012 17:56:51 +0200
Lines: 35
Message-ID: <87393g8cho.fsf@Rainer.invalid>
References: <loom DOT 20120821T114938-389 AT post DOT gmane DOT org> <50337A02 DOT 8070809 AT redhat DOT com> <loom DOT 20120821T153030-47 AT post DOT gmane DOT org> <5033AAB8 DOT 8010705 AT redhat DOT com>
Mime-Version: 1.0
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
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

Eric Blake writes:
> Sorry, POSIX requires that to leave LC_ALL set after the function
> call,

Interesting.  Where is that specified?

> which is not what you want (bash behaves differently according to
> whether it was started as bash or sh).

OK, it wasn't the same as the original invocation anyway since now the
scripts would be called with LC_ALL=C set (which might be exactly what
you wanted, but still...) — so perhaps:

profile_d ()
{
  _LC_SAVE_="$LC_ALL"
  LC_ALL=C
  for file in /etc/profile.d/*.$1 ; do
    [ -e "${file}" ] && LC_ALL="$_LC_SAVE_" . "${file}"
  done
  LC_ALL="$_LC_SAVE_"
  unset file
  unset _LC_SAVE_
}

That leaves the original function calls the same as well.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Factory and User Sound Singles for Waldorf rackAttack:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds


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

- Raw text -


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