use uniq with LC_ALL=C

We make sure that when we uniq, we sort with `LC_ALL=C` as in:

> LC_ALL=C uniq ...

Changed `bin/csv2entry.sh` VERSION from "1.2.1 2024-08-17"
to "1.2.2 2024-08-17".

Performed `make csv2entry` to test the above under macOS.
This commit is contained in:
Landon Curt Noll committed 2024-08-17 16:07:45 -07:00
1 parent 0203a51dd8
commit 6c37038256
1 file changed
+5 -3
+5 -3
View File
@@ -142,7 +142,7 @@ shopt -s lastpipe # explicitly run the last command of the pipe line in the curr
# set variables referenced in the usage message
#
export VERSION="1.2.1 2024-08-17"
export VERSION="1.2.2 2024-08-17"
NAME=$(basename "$0")
export NAME
export V_FLAG=0
@@ -1311,9 +1311,11 @@ fi
# form a 2nd YYYY_DIR inventory from author_wins.csv
#
if [[ $V_FLAG -ge 5 ]]; then
echo "$0: debug[5]: about to: sed .. $AUTHOR_WINS_CSV | LC_ALL=C sort -t/ -d | uniq > $TMP_2ND_YYYY_DIR_INV" 1>&2
echo "$0: debug[5]: about to: sed .. $AUTHOR_WINS_CSV | LC_ALL=C sort -t/ -d | LC_ALL=C uniq > $TMP_2ND_YYYY_DIR_INV" 1>&2
fi
sed -e '/^#/d' -e 's/^[^,]*,//' -e 's/,/\n/g' -e 's/_/\//g' "$AUTHOR_WINS_CSV" | LC_ALL=C sort -t/ -d | uniq > "$TMP_2ND_YYYY_DIR_INV"
sed -e '/^#/d' -e 's/^[^,]*,//' -e 's/,/\n/g' -e 's/_/\//g' "$AUTHOR_WINS_CSV" |
LC_ALL=C sort -t/ -d |
LC_ALL=C uniq > "$TMP_2ND_YYYY_DIR_INV"
status_codes=("${PIPESTATUS[@]}")
if [[ ${status_codes[*]} =~ [1-9] ]]; then
echo "$0: ERROR: sed .. $AUTHOR_WINS_CSV | LC_ALL=C sort -t/ -d > $TMP_2ND_YYYY_DIR_INV failed," \