From 44fb7efd6475fb149601b3979b80da62ebf58d66 Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Tue, 23 Jun 2020 10:57:45 +0200 Subject: Strip quotes in locale output, e.g. macOS --- lynis | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lynis') diff --git a/lynis b/lynis index 76722baa..492cc2f4 100755 --- a/lynis +++ b/lynis @@ -216,7 +216,7 @@ # Extract the short notation of the language (first two characters). if [ -x "$(command -v locale 2> /dev/null)" ]; then - LANGUAGE=$(locale | egrep "^LANG=" | cut -d= -f2 | cut -d_ -f1 | egrep "^[a-z]{2}$") + LANGUAGE=$(locale | egrep "^LANG=" | cut -d= -f2 | cut -d_ -f1 | tr -d '"' | egrep "^[a-z]{2}$") # Try locale command if shell variable had no value if [ -z "${DISPLAY_LANG}" ]; then DISPLAY_LANG=$(locale | egrep "^LANG=" | cut -d= -f2) -- cgit v1.2.3