From be00c478e08275a1d93d1d9db4c2dbe20cc817c9 Mon Sep 17 00:00:00 2001 From: wh201906 Date: Sat, 14 Aug 2021 03:53:33 +0800 Subject: [PATCH] Force locale settings into POSIX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In CJK (Chinese, Japanese and Korean) computing, graphic characters are traditionally classed into fullwidth. For users who use CJK locales, the colon in the output is ':', rather than ':'. The script cannot handle these characers, so forcing locale settings into English temporarily can solve this problem. --- pishrink.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pishrink.sh b/pishrink.sh index 79570b3..c7b1fb3 100755 --- a/pishrink.sh +++ b/pishrink.sh @@ -221,6 +221,14 @@ if (( EUID != 0 )); then exit 3 fi +# set locale to POSIX(English) temporarily +# these locale settings only affect the script and its sub processes + +export LANGUAGE=POSIX +export LC_ALL=POSIX +export LANG=POSIX + + # check selected compression tool is supported and installed if [[ -n $ziptool ]]; then if [[ ! " ${ZIPTOOLS[@]} " =~ $ziptool ]]; then