From 0c787d9a517580f62b9f6da85c86df3a2471e995 Mon Sep 17 00:00:00 2001 From: Bruno Raoult Date: Thu, 8 Dec 2022 12:52:54 +0100 Subject: [PATCH] 2022/bash: move LANG=C to common.bash --- 2022/day01/common.bash | 3 ++- 2022/day02/common.bash | 1 + 2022/day03/aoc.bash | 1 - 2022/day03/common.bash | 1 + 2022/day04/aoc.bash | 2 -- 2022/day04/common.bash | 1 + 2022/day05/common.bash | 1 + 7 files changed, 6 insertions(+), 4 deletions(-) diff --git a/2022/day01/common.bash b/2022/day01/common.bash index f3756df..5af1e54 100755 --- a/2022/day01/common.bash +++ b/2022/day01/common.bash @@ -15,6 +15,7 @@ export cmdname=${0##*/} export debug=0 export res +export LANG=C shopt -s extglob set -o noglob @@ -25,7 +26,7 @@ usage() { } checkargs() { - local part + local part=1 while getopts p:d: todo; do case "$todo" in d) diff --git a/2022/day02/common.bash b/2022/day02/common.bash index c220552..5af1e54 100755 --- a/2022/day02/common.bash +++ b/2022/day02/common.bash @@ -15,6 +15,7 @@ export cmdname=${0##*/} export debug=0 export res +export LANG=C shopt -s extglob set -o noglob diff --git a/2022/day03/aoc.bash b/2022/day03/aoc.bash index 0480cb3..5923ad9 100755 --- a/2022/day03/aoc.bash +++ b/2022/day03/aoc.bash @@ -13,7 +13,6 @@ . common.bash -export LANG=C declare -a input # prio - get priority value for an item diff --git a/2022/day03/common.bash b/2022/day03/common.bash index c220552..5af1e54 100755 --- a/2022/day03/common.bash +++ b/2022/day03/common.bash @@ -15,6 +15,7 @@ export cmdname=${0##*/} export debug=0 export res +export LANG=C shopt -s extglob set -o noglob diff --git a/2022/day04/aoc.bash b/2022/day04/aoc.bash index 0135044..3431488 100755 --- a/2022/day04/aoc.bash +++ b/2022/day04/aoc.bash @@ -13,8 +13,6 @@ . common.bash -export LANG=C - parse() { local -i _part="$1" local -a _arr diff --git a/2022/day04/common.bash b/2022/day04/common.bash index c220552..5af1e54 100755 --- a/2022/day04/common.bash +++ b/2022/day04/common.bash @@ -15,6 +15,7 @@ export cmdname=${0##*/} export debug=0 export res +export LANG=C shopt -s extglob set -o noglob diff --git a/2022/day05/common.bash b/2022/day05/common.bash index c220552..5af1e54 100755 --- a/2022/day05/common.bash +++ b/2022/day05/common.bash @@ -15,6 +15,7 @@ export cmdname=${0##*/} export debug=0 export res +export LANG=C shopt -s extglob set -o noglob