From b225ac85068296054d627f03eb855e20a983eb07 Mon Sep 17 00:00:00 2001 From: Anon Date: Sun, 10 Mar 2024 14:43:10 -0700 Subject: [PATCH] Fixed regex bug that would prevent more than ten lines from being read --- pick_ordered.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pick_ordered.sh b/pick_ordered.sh index 8a2fb12..c4eef1a 100755 --- a/pick_ordered.sh +++ b/pick_ordered.sh @@ -36,7 +36,7 @@ INDEX=1 NLINES="$(wc -l "$MASTER_FILE" | cut -d ' ' -f1)" if [ -s "$LOG_FILE" ];then - INDEX="$(grep ".*Index: [0-9]*$" "$LOG_FILE" | tail -n 1 | grep -o "[0-9]$")" + INDEX="$(grep ".*Index: [0-9]*$" "$LOG_FILE" | tail -n 1 | grep -o "[0-9]*$")" INDEX="$(expr "$INDEX" '%' "$NLINES" '+' '1')" fi PICKED="$(sed "${INDEX}q;d" "$MASTER_FILE")"