diff options
| author | Miquel Sabaté Solà <msabate@suse.com> | 2019-06-26 16:20:53 +0200 |
|---|---|---|
| committer | Miquel Sabaté Solà <msabate@suse.com> | 2019-06-26 16:20:53 +0200 |
| commit | 956f4f46f180891eb474531cc93e2f4961d74939 (patch) | |
| tree | 3e66dd315dfc378407bb549f2c46ff8e1dd7798f | |
| parent | 19663e8af7c60ba840d174f9906ea9932bbc3115 (diff) | |
| download | dotfiles-956f4f46f180891eb474531cc93e2f4961d74939.tar.gz dotfiles-956f4f46f180891eb474531cc93e2f4961d74939.zip | |
bash: check if the locale actually exists
Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
| -rw-r--r-- | bashrc | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -2,7 +2,16 @@ # Locale. # Set LC_ALL always to UTF-8. -export LC_ALL=ca_ES.UTF-8 +if [ "$(locale -a | grep ca_ES.utf8)" != "" ]; then + export LC_ALL=ca_ES.utf8 +else + if [ "$(locale -a | grep en_US.utf8)" != "" ]; then + export LC_ALL=en_US.utf8 + else + echo "[Warning] Could not set up a proper locale." \ + "There is probably something missing on your host machine..." + fi +fi ## # Basics. @@ -148,4 +157,4 @@ alias ssh="gpg-connect-agent updatestartuptty /bye >/dev/null; ssh" # Handy alias for the ip command alias ip="ip --color" -alias ipb="ip --color --brief"
\ No newline at end of file +alias ipb="ip --color --brief" |
