feat: script to count pdf pages

This commit is contained in:
2026-07-25 16:43:05 +02:00
parent 0ec2614799
commit 6d2306e3f7
3 changed files with 17 additions and 11 deletions
+16
View File
@@ -0,0 +1,16 @@
#!/bin/sh
if [[ -n $1 ]]; then
echo "File contains $(pdfinfo $1 | awk '/^Pages:/ {print $2}') pages"
else
total=0
for file in *.pdf; do
count=$(pdfinfo $file | awk '/^Pages:/ {print $2}')
echo "$count pages in $file"
total=$(($total + count))
done
echo "
Total page count is $total
"
fi