From 06e977510cd03b9c56a118b7afdc33ac97c1d88a Mon Sep 17 00:00:00 2001 From: mid-kid Date: Sat, 2 Dec 2023 14:56:01 +0100 Subject: [PATCH] Use $1 as puzzle input --- d01.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/d01.sh b/d01.sh index df37546..75a94d1 100755 --- a/d01.sh +++ b/d01.sh @@ -5,7 +5,7 @@ while read line; do num1="$(echo "$line" | sed -n 's/^[^0-9]*\([0-9]\).*/\1/p')" num2="$(echo "$line" | sed -n 's/.*\([0-9]\)[^0-9]*$/\1/p')" sum=$(( $sum + $num1$num2 )) -done < d01_input.txt +done < "$1" echo "$sum" sum=0 @@ -35,5 +35,5 @@ while read line; do num1="$(echo "$line1" | sed -n 's/^[^0-9]*\([0-9]\).*/\1/p')" num2="$(echo "$line2" | sed -n 's/.*\([0-9]\)[^0-9]*$/\1/p')" sum=$(( $sum + $num1$num2 )) -done < d01_input.txt +done < "$1" echo "$sum"