From 3b634504917ad84952ab6b8563c4815f93b928c7 Mon Sep 17 00:00:00 2001 From: asntech Date: Fri, 22 Nov 2019 11:49:22 +0100 Subject: [PATCH] set lines to 0 to avoid increment in number of lines --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ef1cc87..dba6153 100644 --- a/README.md +++ b/README.md @@ -458,6 +458,7 @@ lines() { # 'read' exits with '1' when it sees EOL and # without the added test, the line isn't sent # to the loop. + lines=0 while IFS= read -r line || [ -n "$line" ]; do lines=$((lines+1)) done < "$1"