From 9b7f6f9c2124e04ad56d87a82363b7d3d5d773df Mon Sep 17 00:00:00 2001 From: Jonny007-MKD Date: Sun, 9 Feb 2020 16:40:17 +0100 Subject: [PATCH] Simply use wc for counting lines --- check_rebootrequired.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/check_rebootrequired.sh b/check_rebootrequired.sh index a33218b..a497687 100755 --- a/check_rebootrequired.sh +++ b/check_rebootrequired.sh @@ -5,11 +5,7 @@ if [ ! -f "$INPUT" ]; then exit 0 fi -NUM_LINES=0 -while IFS= read -r line; do - ((NUM_LINES++)) -done < "$INPUT" - +NUM_LINES=`cat "$INPUT" | wc -l` echo "WARNING: $NUM_LINES packages require a reboot:" cat "$INPUT"