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 Subject: Re: /etc/profile Date: Tue, 21 Aug 2012 17:56:51 +0200 Lines: 35 Message-ID: <87393g8cho.fsf@Rainer.invalid> References: <50337A02 DOT 8070809 AT redhat DOT com> <5033AAB8 DOT 8010705 AT redhat DOT 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 AT cygwin DOT com; run by ezmlm List-Id: 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 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