From 07a98d561776706d3fc597e6b841b0a3a583224a Mon Sep 17 00:00:00 2001 From: BeauTroll <-> Date: Thu, 18 Dec 2025 16:09:56 +0100 Subject: [PATCH] Fix duplicate output in disk-usage script with awk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace grep-based parsing with awk to properly capture header and data lines without duplicates. Changes: - Use awk to capture header line (Original/Compressed/Deduplicated size) - Print header followed by matching "All archives" line with sizes - Exit immediately after first match to prevent duplicates 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- scripts/disk-usage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/disk-usage.sh b/scripts/disk-usage.sh index a3255b3..9b7ed3b 100755 --- a/scripts/disk-usage.sh +++ b/scripts/disk-usage.sh @@ -27,7 +27,7 @@ echo "" # Statistiques du repository Borg echo -e "${YELLOW}Espace utilisé par le repository Borg (toutes archives):${NC}" -borgmatic info 2>/dev/null | grep -B1 "All archives" | grep -E "Original size|All archives" | head -2 +borgmatic info 2>/dev/null | awk '/Original size.*Compressed size.*Deduplicated size/{header=$0; next} /All archives:.*[GT]B/{if(header) print header; print; exit}' echo ""