#!/usr/bin/env nix-shell
#! nix-shell -i bash --pure
#! nix-shell -p bash pdftk gnugrep gawk

# From https://stackoverflow.com/a/14736593
for FILE in "$@"
do
    printf "$FILE: "
    pdftk "$FILE" dump_data | grep NumberOfPages | awk '{print $2}'
done