Simply use wc for counting lines
This commit is contained in:
parent
29af3677f5
commit
9b7f6f9c21
1 changed files with 1 additions and 5 deletions
|
@ -5,11 +5,7 @@ if [ ! -f "$INPUT" ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
NUM_LINES=0
|
NUM_LINES=`cat "$INPUT" | wc -l`
|
||||||
while IFS= read -r line; do
|
|
||||||
((NUM_LINES++))
|
|
||||||
done < "$INPUT"
|
|
||||||
|
|
||||||
echo "WARNING: $NUM_LINES packages require a reboot:"
|
echo "WARNING: $NUM_LINES packages require a reboot:"
|
||||||
cat "$INPUT"
|
cat "$INPUT"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue