dotfiles/config/nix/scripts/pdfpages
Geoffrey Frogeye 1f61ceb395
nix: Migrate scripts
They're a bit slower to start :(.
Hopefully this is something that flakes will help with,
otherwise I'll find another way.
2023-11-26 21:04:58 +01:00

11 lines
252 B
Plaintext
Executable file

#!/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