From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21561 invoked by alias); 21 Aug 2012 15:57:35 -0000 Received: (qmail 21550 invoked by uid 22791); 21 Aug 2012 15:57:33 -0000 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 Received: from plane.gmane.org (HELO plane.gmane.org) (80.91.229.3) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 21 Aug 2012 15:57:17 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1T3qpN-0006XD-1Z for cygwin@cygwin.com; Tue, 21 Aug 2012 17:57:13 +0200 Received: from pd9eb502d.dip.t-dialin.net ([217.235.80.45]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 21 Aug 2012 17:57:13 +0200 Received: from Stromeko by pd9eb502d.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 21 Aug 2012 17:57:13 +0200 To: cygwin@cygwin.com From: Achim Gratz Subject: Re: /etc/profile Date: Tue, 21 Aug 2012 17:21:00 -0000 Message-ID: <87393g8cho.fsf@Rainer.invalid> References: <50337A02.8070809@redhat.com> <5033AAB8.8010705@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) X-IsSubscribed: yes Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2012-08/txt/msg00496.txt.bz2 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