From 66b72938cc1b2d0c013d95780a6fffbf41e1742b Mon Sep 17 00:00:00 2001 From: Alexei Date: Thu, 3 Oct 2024 12:15:16 -0400 Subject: [PATCH] Fix off-by-one counting bug --- search_log.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/search_log.sh b/search_log.sh index 8519282..f40b0ad 100755 --- a/search_log.sh +++ b/search_log.sh @@ -80,7 +80,7 @@ show_most_recent_matches() { sites_sample=$(echo "$sites" | cut -d ',' -f '1-3') dotdotdot= if [ "$sites_sample" != "$sites" ]; then - dotdotdot=", ...$(($(echo "$sites" | tr -dc ',' | wc -c) - 3)) more" + dotdotdot=", ...$(($(echo "$sites" | tr -dc ',' | wc -c) + 1 - 3)) more" fi printf '%s|%s%s\n' \ "$(echo "$line" | cut -d '|' -f '1-4')" \