summaryrefslogtreecommitdiffstats
path: root/bashrc
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2011-12-09 03:05:29 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2011-12-09 03:05:29 +0100
commitf40378376d30eb8413ef16b265cd758fc84b0ded (patch)
tree5482a9b2894702f07399864a979753b2b17beb30 /bashrc
parent7b1306a069bd761118298a45b201008af19af845 (diff)
downloaddotfiles-f40378376d30eb8413ef16b265cd758fc84b0ded.tar.gz
dotfiles-f40378376d30eb8413ef16b265cd758fc84b0ded.tar.xz
dotfiles-f40378376d30eb8413ef16b265cd758fc84b0ded.zip
first check if locale binary exists
under openbsd locale is not available, so disable locale handling to avoid errors
Diffstat (limited to 'bashrc')
-rw-r--r--bashrc/common/locale.sh10
1 files changed, 6 insertions, 4 deletions
diff --git a/bashrc/common/locale.sh b/bashrc/common/locale.sh
index b337292..b75b3aa 100644
--- a/bashrc/common/locale.sh
+++ b/bashrc/common/locale.sh
@@ -2,10 +2,12 @@
eval unset ${!LC_*} LANG
-if locale -a | grep "en_US.UTF-8" 2>&1 >/dev/null ; then
- export LANG="en_US.UTF-8"
-elif locale -a | grep "en_US.utf8" 2>&1 >/dev/null ; then
- export LANG="en_US.utf8"
+if hash locale 2>&1 >/dev/null ; then
+ if locale -a | grep "en_US.UTF-8" 2>&1 >/dev/null ; then
+ export LANG="en_US.UTF-8"
+ elif locale -a | grep "en_US.utf8" 2>&1 >/dev/null ; then
+ export LANG="en_US.utf8"
+ fi
fi
export LC_COLLATE="C"