From a557e285a2a5737e7dcbf34a331c15ea72b69514 Mon Sep 17 00:00:00 2001 From: d00f <8052722+DrDoof@users.noreply.github.com> Date: Thu, 29 Oct 2026 20:47:31 +0100 Subject: [PATCH] tools: keep the bank table aligned in a terminal printf pads the cells, so the table lines up on the console and is still a markdown table in the job summary. --- tools/bank_occupancy.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/bank_occupancy.sh b/tools/bank_occupancy.sh index 526cb281..4e895c33 100755 --- a/tools/bank_occupancy.sh +++ b/tools/bank_occupancy.sh @@ -26,13 +26,13 @@ web() { print_line() { local name=$1 main=$2 branch=$3 - echo "| $name | $main | $branch | $((${branch:-0} - ${main:-0})) |" + printf '| %-15s | %7s | %7s | %7s |\n' "$name" "$main" "$branch" "$((${branch:-0} - ${main:-0}))" } echo "### $MACHINE" echo -echo "| segment | main | branch | change |" -echo "| --- | ---: | ---: | ---: |" +printf '| %-15s | %7s | %7s | %7s |\n' "segment" "main" "branch" "change" +echo "| --------------- | ------: | ------: | ------: |" for s in HOME CSEG BANK1 BANK2 BANK3 BANK4 DSEG XSEG; do print_line "$s" "$(seg "$s" "$MAIN")" "$(seg "$s" "$BRANCH")" done