diff --git a/pdfform.sh b/pdfform.sh index aa986da9c235e7a89f688c193906686bfb98ab0c..7b2746efd562736f8338933875cb27c902d22d3e 100644 --- a/pdfform.sh +++ b/pdfform.sh @@ -9,6 +9,7 @@ ## v2 23-12-23 alban: add help text and error message ## v3 24-01-15 alban: add acceptance for wildcard * ## v4 24-01-17 alban: add file type check +## v5 24-01-23 alban: add binary check ## @@ -17,6 +18,18 @@ helptext () { } ## check for binaries needed +## give needed binaries as space-seperated entries in variable $progs2check +## +progs2check="pdftk" +## +for prog in $progs2check; do + if ! which "$prog" > /dev/null; then + echo "\n ERROR: Couldn't find the program $prog. \n" + exit 1 + fi +done + +## help request as parameter # TBD ## no parameter @@ -25,9 +38,6 @@ if [ -z "$1" ]; then helptext exit 0 fi -## help request as parameter -# TBD - ## set internal field separator (IFS) because of possible spaces in file names IFS="