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