From f15e0836e37796687cdf7509cbe9ab38d5889782 Mon Sep 17 00:00:00 2001 From: "xiongdian.me" Date: Sun, 4 Dec 2022 17:45:28 +0800 Subject: [PATCH] fix error when locale not exists --- .zshrc2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.zshrc2 b/.zshrc2 index 1ecb5a0..5493eff 100644 --- a/.zshrc2 +++ b/.zshrc2 @@ -1,6 +1,6 @@ # env for shell export TERM="xterm-256color" -if ( locale -a | grep -qxE "C.UTF-8|C.utf8" ); then +if (command -v locale >/dev/null) && ( locale -a | grep -qxE "C.UTF-8|C.utf8" ); then export LC_ALL=C.UTF-8 export LANG=C.UTF-8 else