From 1a22f77c824c32e9f571c72360dce00784894577 Mon Sep 17 00:00:00 2001 From: "tlimoncelli@stackoverflow.com" Date: Mon, 15 May 2017 07:50:30 -0400 Subject: [PATCH] Improve FreeBSD compatibility --- tools/confidence_test.sh | 2 +- tools/test_functions.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/confidence_test.sh b/tools/confidence_test.sh index 1f25be9..4e69eb7 100755 --- a/tools/confidence_test.sh +++ b/tools/confidence_test.sh @@ -192,7 +192,7 @@ become_bob # This users's default group: DEFAULT_GID_NUM=$(id -g) # Pick a group that is not the default group: -TEST_GID_NUM=$(id -G | fmt -1 | grep -xv "$(id -u)" | grep -xv "$(id -g)" | head -1) +TEST_GID_NUM=$(id -G | fmt -1 | sort -rn | grep -xv "$(id -u)" | grep -xv "$(id -g)" | head -1) echo "DEFAULT_GID_NUM=$DEFAULT_GID_NUM" echo "TEST_GID_NUM=$TEST_GID_NUM" diff --git a/tools/test_functions.sh b/tools/test_functions.sh index cff230e..fda223e 100755 --- a/tools/test_functions.sh +++ b/tools/test_functions.sh @@ -21,7 +21,7 @@ function PHASE() { function md5sum_file() { # Portably generate the MD5 hash of file $1. case $(uname -s) in - Darwin ) + Darwin | FreeBSD ) md5 -r "$1" | awk '{ print $1 }' ;; Linux )