set lines to 0 to avoid increment in number of lines

This commit is contained in:
asntech 2019-11-22 11:49:22 +01:00
parent 6485d201ac
commit 3b63450491

View file

@ -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"