From ec1f958f9d069154cbe7461d1860a5de7c25911f Mon Sep 17 00:00:00 2001 From: Clement Date: Fri, 6 Dec 2024 12:46:43 +0800 Subject: [PATCH] Stupid stuff --- 2024/day-5/solution-2.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/2024/day-5/solution-2.sh b/2024/day-5/solution-2.sh index 44a7572..e472df0 100644 --- a/2024/day-5/solution-2.sh +++ b/2024/day-5/solution-2.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -INPUT_RULES=$(cat input-rules) +INPUT_RULES=$(sort -n input-rules) { while read -r LINE do @@ -45,7 +45,7 @@ INPUT_RULES=$(cat input-rules) break fi done - if [[ $BREAK -eq 1 ]] ; then continue ; else break ; fi + if [[ $BREAK -eq 0 ]] ; then break ; fi done printf "%s\n" "$KEY" CACHED_LINE=$( printf "%s" "$CACHED_LINE" | grep -v "$KEY" )