Page 1 of 1

passes shell script error

PostPosted: Tue Jun 07, 2022 7:47 am
by awaldraff
Hello!

I have used the following script for several years to test a PDF for encryption. Moved to a M1 Mac and it stopped working

qpdf --requires-password "$1"
if [[ $? = 3 ]]; then
exit 0
else
exit 1
fi

QPDF is installed and if I run it on terminal it works perfectly and answers with a code = 3
I tried reversing the exit codes in the if statement to see if the exit code was giving a wrong answer, but the if statement fails either way

What could be the error?

Re: passes shell script error

PostPosted: Tue Jun 07, 2022 10:02 am
by Mr_Noodle
Try specifying the full path to the qpdf binary.