feat: improved pdf page count script
This commit is contained in:
@@ -4,13 +4,17 @@ if [[ -n $1 ]]; then
|
|||||||
echo "File contains $(pdfinfo $1 | awk '/^Pages:/ {print $2}') pages"
|
echo "File contains $(pdfinfo $1 | awk '/^Pages:/ {print $2}') pages"
|
||||||
else
|
else
|
||||||
total=0
|
total=0
|
||||||
|
count=0
|
||||||
for file in *.pdf; do
|
for file in *.pdf; do
|
||||||
count=$(pdfinfo $file | awk '/^Pages:/ {print $2}')
|
count_file=$(pdfinfo $file | awk '/^Pages:/ {print $2}')
|
||||||
echo "$count pages in $file"
|
echo "$count_file pages in $file"
|
||||||
total=$(($total + count))
|
total=$(($total + count_file))
|
||||||
|
count=$((count + 1))
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "
|
echo "
|
||||||
Total page count is $total
|
-> Total page count: $total
|
||||||
|
-> Total files: $count
|
||||||
|
-> Median: $(($total / $count))
|
||||||
"
|
"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user