Forcing locale "C" to avoid grep ambiguities and locale bugs

This commit is contained in:
Thomas Schmitt 2019-12-08 19:39:09 +01:00
parent 157cb19092
commit 697c8cc1f9

View File

@ -5,6 +5,9 @@
# Thomas Schmitt <scdbackup@gmx.net> # Thomas Schmitt <scdbackup@gmx.net>
# Provided under GPL version 2 or later. # Provided under GPL version 2 or later.
export LANG=C
export LC_ALL=C
# Check whether we are on GNU/Linux # Check whether we are on GNU/Linux
if uname -s | grep -v '^Linux' >/dev/null if uname -s | grep -v '^Linux' >/dev/null
then then
@ -139,7 +142,7 @@ round_down_div_million() {
check_parameter() { check_parameter() {
if test "$2" = "device_name" if test "$2" = "device_name"
then then
if echo "$1" | grep '[^A-za-z0-9_/-]' >/dev/null if echo "$1" | grep '[^A-Za-z0-9_/-]' >/dev/null
then then
echo "SORRY: Given device name contains unexpected character. Ok: [A-za-z0-9_/-]" >&2 echo "SORRY: Given device name contains unexpected character. Ok: [A-za-z0-9_/-]" >&2
exit 12 exit 12