From ce9edf7e8f698652648a508547a0ac56217dfe1b Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Mon, 15 Sep 2008 10:00:00 +0000 Subject: [PATCH] More tty and globbing fixes. git-svn-id: https://svn.cambridge.iain.cx/profile/trunk@148 6be0d1a5-5cfe-0310-89b6-964be062b18b --- .bash_profile | 18 ++++++++++++++---- .bashrc | 6 ++++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.bash_profile b/.bash_profile index e061e9c..d0db134 100644 --- a/.bash_profile +++ b/.bash_profile @@ -5,11 +5,21 @@ if $(tty -s) || [ "${0:0:1}" = "-" ]; then nocg=$? # Turn it off so we source stuff in the right order. shopt -u nocaseglob - # And set case-sensitive matching - LC_CTYPE=en_GB; LANG= + + # Remember LC_ALL. + lc_all=$LC_ALL + # Turn it off to set case-sensitive matching + LC_ALL=C + + # Source all scripts. for i in ~/.profile.d/*.bashrc; do . $i; done; unset i - # Maybe turn it back on. + + # Maybe turn nocaseglob back on. [ $nocg = 0 ] && shopt -s nocaseglob - unset nocg + + # Reset LC_ALL. + LC_ALL=$lc_all + + unset lc_all nocg __ps1 fi diff --git a/.bashrc b/.bashrc index d4157fc..c844bd5 100644 --- a/.bashrc +++ b/.bashrc @@ -1,3 +1,5 @@ # $Id$ -. /etc/profile -. ~/.bash_profile +if $(tty -s); then + . /etc/profile + . ~/.bash_profile +fi -- 2.20.1