17 lines
333 B
Bash
Executable File
17 lines
333 B
Bash
Executable File
#!/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
|