From b550a5761510488362c24dc4b13222c6af6972a9 Mon Sep 17 00:00:00 2001 From: Kenneth Ballard Date: Mon, 21 Aug 2023 11:10:01 -0500 Subject: [PATCH] Using perl to generate the percent text. "bc" isn't available on TrueNAS SCALE. (#24) --- zfs-inplace-rebalancing.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zfs-inplace-rebalancing.sh b/zfs-inplace-rebalancing.sh index 66b8224..c69f155 100755 --- a/zfs-inplace-rebalancing.sh +++ b/zfs-inplace-rebalancing.sh @@ -69,7 +69,7 @@ function rebalance () { fi current_index="$((current_index + 1))" - progress_percent=$(echo "scale=2; ${current_index}*100/${file_count}" | bc) + progress_percent=$(perl -e "printf('%0.2f', ${current_index}*100/${file_count})") color_echo "${Cyan}" "Progress -- Files: ${current_index}/${file_count} (${progress_percent}%)" if [[ ! -f "${file_path}" ]]; then